Skip to content

Commit

Permalink
Use bool instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsimcha committed Dec 11, 2011
1 parent 93ccd0c commit c487da7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions std/concurrency.d
Expand Up @@ -17,17 +17,16 @@
* import std.stdio;
* import std.concurrency;
*
* enum int success = 1;
*
* void spawnedFunc(Tid tid)
* {
* // Receive a message from the owner thread.
* receive(
* (int i) { writeln("Received the number ", i);}
* );
*
* // Send a message back to the owner thread.
* send(tid, success);
* // Send a message back to the owner thread
* // indicating success.
* send(tid, true);
* }
*
* void main()
Expand All @@ -39,8 +38,8 @@
* send(tid, 42);
*
* // Receive the result code.
* auto resultCode = receiveOnly!(int);
* assert(resultCode == success);
* auto wasSuccessful = receiveOnly!(int);
* assert(wasSuccessful);
* writeln("Successfully printed number.");
* }
* ---
Expand Down

0 comments on commit c487da7

Please sign in to comment.