Difference between revisions of "Nsv incr"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 842)
(No difference)

Revision as of 11:39, 26 October 2004

Man page: http://aolserver.com/docs/tcl/nsv_incr.html


NAME

nsv_incr - Increment the value of the element in the nsv array arrayName specified by key

SYNOPSIS

nsv_incr arrayName key ?increment?

DESCRIPTION

If increment is supplied then its value (which must be an integer) is added to the value of the element key; otherwise 1 is added to the value of the element key. Unlike the TCL equivalent if key does not exists it is created. Returns the new value of the element specified by key. Internally interlocked so it is thread safe, no mutex required.

EXAMPLES

   % nsv_incr shared_array foo
   1
   % nsv_incr shared_array foo -1
   0

SEE ALSO

Thread-shared Variables

Category Documentation - Category Core Tcl API