Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cml/src/core-cml/sync-var.sml
ViewVC logotype

Diff of /sml/trunk/src/cml/src/core-cml/sync-var.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 651, Thu Jun 1 18:34:03 2000 UTC revision 1924, Thu May 4 20:17:04 2006 UTC
# Line 176  Line 176 
176              R.BEVT[pollFn]              R.BEVT[pollFn]
177            end            end
178    
179      fun iGetPoll (CELL{priority, readQ, value}) = (      fun iGetPoll (CELL{priority, readQ, value}) = let
180              val res = (
181            S.atomicBegin();            S.atomicBegin();
182            case !value            case !value
183             of NONE => NONE             of NONE => NONE
184              | (SOME v) => (S.atomicEnd(); SOME v)                    | (SOME v) => SOME v
185            (* end case *))            (* end case *))
186              in
187                S.atomicEnd();
188                res
189              end
190    
191    
192    (** M-variables **)    (** M-variables **)
# Line 243  Line 248 
248              R.BEVT[pollFn]              R.BEVT[pollFn]
249            end            end
250    
251      fun mTakePoll (CELL{priority, readQ, value}) = (      fun mTakePoll (CELL{priority, readQ, value}) = let
252              val res = (
253            S.atomicBegin();            S.atomicBegin();
254            case !value            case !value
255             of NONE => NONE             of NONE => NONE
256              | (SOME v) => (value := NONE; S.atomicEnd(); SOME v)                    | (SOME v) => (value := NONE; SOME v)
257            (* end case *))            (* end case *))
258              in
259                S.atomicEnd(); res
260              end
261    
262      fun mGet (CELL{priority, readQ, value}) = (      fun mGet (CELL{priority, readQ, value}) = (
263            S.atomicBegin();            S.atomicBegin();
# Line 336  Line 345 
345            end            end
346    
347    end; (* SyncVar *)    end; (* SyncVar *)
   

Legend:
Removed from v.651  
changed lines
  Added in v.1924

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0