Draft implementation of mutex_property/2.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1847 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
a5b0925e08
commit
35fb866f2d
@ -415,6 +415,20 @@ current_mutex(M, T, NRefs) :-
|
|||||||
recorded('$mutex_alias',[Id|M],_),
|
recorded('$mutex_alias',[Id|M],_),
|
||||||
'$mutex_info'(Id, NRefs, T).
|
'$mutex_info'(Id, NRefs, T).
|
||||||
|
|
||||||
|
mutex_property(Mutex, Prop) :-
|
||||||
|
( nonvar(Mutex) ->
|
||||||
|
'$check_mutex_or_alias'(Mutex, mutex_property(Mutex, Prop))
|
||||||
|
; recorded('$mutex_alias', [_|Mutex], _)
|
||||||
|
),
|
||||||
|
'$check_mutex_property'(Prop, mutex_property(Mutex, Prop)),
|
||||||
|
'$mutex_id_alias'(Id, Mutex),
|
||||||
|
'$mutex_property'(Id, Prop).
|
||||||
|
|
||||||
|
'$mutex_property'(Id, alias(Alias)) :-
|
||||||
|
recorded('$mutex_alias', [Id|Alias], _).
|
||||||
|
'$mutex_property'(Id, locked(Thread, Count)) :-
|
||||||
|
'$mutex_info'(Id, Count, Thread).
|
||||||
|
|
||||||
message_queue_create(Cond) :-
|
message_queue_create(Cond) :-
|
||||||
var(Cond), !,
|
var(Cond), !,
|
||||||
mutex_create(Mutex),
|
mutex_create(Mutex),
|
||||||
@ -689,5 +703,6 @@ threads :-
|
|||||||
'$check_mutex_property'(Term, _) :-
|
'$check_mutex_property'(Term, _) :-
|
||||||
var(Term), !.
|
var(Term), !.
|
||||||
'$check_mutex_property'(alias(_), _) :- !.
|
'$check_mutex_property'(alias(_), _) :- !.
|
||||||
'$check_thread_property'(Term, Goal) :-
|
'$check_mutex_property'(locked(_, _), _) :- !.
|
||||||
'$do_error'(domain_error(thread_property, Term), Goal).
|
'$check_mutex_property'(Term, Goal) :-
|
||||||
|
'$do_error'(domain_error(mutex_property, Term), Goal).
|
||||||
|
Reference in New Issue
Block a user