Changeset 4462 for trunk/compiler

Show
Ignore:
Timestamp:
08/31/08 10:12:04 (4 months ago)
Author:
pmoura
Message:

Simplified implementation of the asynchrounous built-in multi-threading predicates.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4461 r4462  
    1317113171'$lgt_mt_dispatch_goal'(call, Queue, Goal, This, Self, Tag) :- 
    1317213172    thread_create('$lgt_mt_non_det_goal'(Queue, Goal, This, Self, Tag), Id, []), 
    13173     % wait until the thread created for proving the goal is ready before proceeding: 
    13174     thread_get_message(Queue, '$lgt_non_det_ready'(Id)). 
     13173    thread_send_message(Queue, '$lgt_thread_id'(call, Goal, This, Self, Tag, Id)). 
    1317513174 
    1317613175'$lgt_mt_dispatch_goal'(once, Queue, Goal, This, Self, Tag) :- 
    1317713176    thread_create('$lgt_mt_det_goal'(Queue, Goal, This, Self, Tag), Id, []), 
    13178     % wait until the thread created for proving the goal is ready before proceeding: 
    13179     thread_get_message(Queue, '$lgt_det_ready'(Id)). 
     13177    thread_send_message(Queue, '$lgt_thread_id'(once, Goal, This, Self, Tag, Id)). 
    1318013178 
    1318113179 
     
    1318713185'$lgt_mt_det_goal'(Queue, Goal, This, Self, Tag) :- 
    1318813186    thread_self(Id), 
    13189     thread_send_message(Queue, '$lgt_thread_id'(once, Goal, This, Self, Tag, Id)), 
    13190     % signal that the thread running the goal is ready: 
    13191     thread_send_message(Queue, '$lgt_det_ready'(Id)), 
    1319213187    (   catch(Goal, Error, thread_send_message(Queue, '$lgt_reply'(Goal, This, Self, Tag, Error, Id))) -> 
    1319313188        (   var(Error) -> 
     
    1320713202'$lgt_mt_non_det_goal'(Queue, Goal, This, Self, Tag) :- 
    1320813203    thread_self(Id), 
    13209     thread_send_message(Queue, '$lgt_thread_id'(call, Goal, This, Self, Tag, Id)), 
    13210     % signal that the thread running the goal is ready: 
    13211     thread_send_message(Queue, '$lgt_non_det_ready'(Id)), 
    1321213204    (   catch(Goal, Error, thread_send_message(Queue, '$lgt_reply'(Goal, This, Self, Tag, Error, Id))), 
    1321313205        (   var(Error) ->