Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Return value of condvar's recv should be an item.

Types and contexts of received values can be vary. To keep it
simple and flexible, it should be an Any scalar or Parcel.
  • Loading branch information...
commit 19d57b598b82ce8641eb1ac5685c3171f34732d6 1 parent f491b73
Hojung Youn authored October 30, 2012

Showing 1 changed file with 4 additions and 5 deletions. Show diff stats Hide diff stats

  1. 9  lib/MuEvent.pm
9  lib/MuEvent.pm
@@ -8,19 +8,18 @@ my $since;
8 8
 
9 9
 class MuEvent::Condvar {
10 10
     has &.cb;
11  
-    has @.sent is rw;
  11
+    has $.sent is rw;
12 12
     has $.flag is rw = False;
13 13
 
14  
-    method send(*@data) {
  14
+    method send($data?) {
15 15
         &.cb() if &.cb;
16  
-        @.sent = @data if @data;
  16
+        $.sent = $data if $data.defined;
17 17
         $.flag = True;
18 18
     }
19 19
     method recv() {
20 20
         $since = clock() unless $since.defined;
21 21
         MuEvent::_poll until $.flag;
22  
-        return unless @.sent;
23  
-        return @.sent > 1 ?? @.sent !! @.sent[0];
  22
+        $.sent;
24 23
     }
25 24
 }
26 25
 

0 notes on commit 19d57b5

Please sign in to comment.
Something went wrong with that request. Please try again.