lockSymbol: Try to lock or unlock a symbol, preventing any other...

Description Usage Arguments Value Note

View source: R/lockSymbol.R

Description

This is mainly to prevent interleaved access to receiver and other databases.

Usage

1
lockSymbol(symbol, owner = getPGID(), lock = TRUE, block = TRUE)

Arguments

symbol

character scalar; this can be a receiver serial number, database filename, or other arbitrary unique symbol.

owner

integer; defaults to process group id of the R session, but any integer uniquely associated with the process can be used. The owner is recorded in the symLocks table of the motus server database when locking is successful (indeed, 'successful' means that after attempting to lock the symbol, the owner associated with it is this parameter).

lock

logical scalar; if TRUE, try unlock the receiver; otherwise, release any lock.

block

logical scalar; if TRUE, the default, don't return until locking the symbol has succeeded. Otherwise, return immediately with TRUE or FALSE.

Value

if lock is TRUE, then return TRUE if this process now has an exclusive lock on the symbol, otherwise FALSE. If lock is FALSE, then always return TRUE.

Note

requires existence of the symbol ServerDB in the global environment; this can be ensured by first calling


jbrzusto/motusServer documentation built on May 19, 2019, 8:19 a.m.