This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef struct WorkerParams { | |
| int thread_id; | |
| Log * log; | |
| Jobs * jobs; | |
| pthread_mutex_t jobs_lock; | |
| pthread_cond_t work_added; | |
| } WorkerParams; | |
| void main() { | |
| launch_master_node(3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // implementation 1 | |
| object Users { | |
| var users: Seq[User] = Seq() | |
| def delete(id: Long) : Option[Int] = { | |
| val originalSize = users.length | |
| this.users = users.filterNot(_.id == id) | |
| Some(originalSize - users.length) | |
| } | |
| } |
OlderNewer