synchronized(Functor/Arity) synchronized(Functor1/Arity1, Functor2/Arity2, ...) synchronized([Functor1/Arity1, Functor2/Arity2, ...]) synchronized(Functor//Arity) synchronized(Functor1//Arity1, Functor2//Arity2, ...) synchronized([Functor1//Arity1, Functor2//Arity2, ...])
Declares synchronized predicates and synchronized grammar rule non-terminals. A synchronized predicate (or synchronized non-terminal) is protected by a mutex in order to allow for thread synchronization when proving a call to the predicate (or non-terminal). All predicates declared in the same synchronized directive share the same mutex. In order to use a separate mutex for each predicate (so that they are independently synchronized), a per-predicate synchronized directive must be used. Synchronized predicates are silently compiled as normal predicates on Prolog compilers that don't support multi-threading programming.
synchronized(+predicate_indicator_term) synchronized(+non_terminal_indicator_term)
:- synchronized(db_update/1). :- synchronized(write_stream/2, read_stream/2). :- synchronized([add_to_queue/2, remove_from_queue/2]).