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 1926, Mon May 15 20:15:32 2006 UTC revision 1927, Wed May 17 14:45:48 2006 UTC
# Line 176  Line 176 
176              R.BEVT[pollFn]              R.BEVT[pollFn]
177            end            end
178    
179      fun iGetPoll (CELL{priority, readQ, value}) = let    (* NOTE: we assume that reads are atomic, so this function does not
180            val res = (     * need to run in an atomic region.
181                  S.atomicBegin();     *)
182                  case !value      fun iGetPoll (CELL{value, ...}) = !value
                  of NONE => NONE  
                   | (SOME v) => SOME v  
                 (* end case *))  
           in  
             S.atomicEnd();  
             res  
           end  
183    
184    
185    (** M-variables **)    (** M-variables **)
# Line 294  Line 287 
287              R.BEVT[pollFn]              R.BEVT[pollFn]
288            end            end
289    
290      fun mGetPoll (CELL{priority, readQ, value}) = (    (* NOTE: we assume that reads are atomic, so this function does not
291            S.atomicBegin();     * need to run in an atomic region.
292            case !value     *)
293             of NONE => NONE      fun mGetPoll (CELL{value, ...}) = !value
             | (SOME v) => (S.atomicEnd(); SOME v)  
           (* end case *))  
294    
295    (* Swap the current contents of the cell with a new value.  This function    (* Swap the current contents of the cell with a new value.  This function
296     * has the effect of an mTake followed by an mPut, except that it is     * has the effect of an mTake followed by an mPut, except that it is

Legend:
Removed from v.1926  
changed lines
  Added in v.1927

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