atomic-pushPortable Threadsawaken-threadatomic-pushnewGoTo Top

atomic-pushnew   item place &key key test test-not => new-place-value[Macro]

Purpose
As an atomic operation, when item is not the same as any element in the list stored in place, prepend item to the list and store the updated list in place.

Package   :portable-threads

Module   :portable-threads

Arguments and values

item     An object
place     A form which is suitable for use as a generalized reference that contains a proper list
key     A function designator specifying a function object of one argument, or nil (default is nil)
test     A function designator specifying a function object of two arguments that returns a generalized boolean (default is #'eql)
test-not     A function designator specifying a function object of two arguments that returns a generalized boolean (use of :test-not is deprecated)
new-place-value     A proper list

Returns
The new value of place.

See also
    as-atomic-operation
    atomic-delete
    atomic-flush
    atomic-pop
    atomic-push

Examples

  > list
  (1 2 3)
  > (atomic-pushnew 2 list)
  (1 2 3)
  > (atomic-pushnew 10 list)
  (10 1 2 3)
  >


The GBBopen Project


atomic-pushPortable Threadsawaken-threadatomic-pushnewGoTo Top