Cg Core Runtime API cgSetLockingPolicy(3)
NAME
cgSetLockingPolicy - set locking policy
SYNOPSIS
#include
CGenum cgSetLockingPolicy( CGenum lockingPolicy );
PARAMETERS
lockingPolicy
An enumerant describing the desired locking policy
for the library. The following enumerants are
allowed:
CGTHREADSAFEPOLICY
Locks will be used to serialize thread access to
the library.
CGNOLOCKSPOLICY
Locks will not be used.
RETURN VALUES
Returns the previous locking policy, or CGUNKNOWN if an
error occurs.
DESCRIPTION
cgSetLockingPolicy allows an application to change the
locking policy used by the Cg library. The default policy
is CGTHREADSAFEPOLICY, meaning a lock is used to
serialize access to the library by mulitiple threads.
Single threaded applications can change this policy to
CGNOLOCKSPOLICY to avoid the overhead associated with
this lock. Multithreaded applications should never change
this policy.
EXAMPLES
/* multithreaded apps should *never* do this */
cgSetLockingPolicy(CGNOLOCKSPOLICY);
ERORS
CGINVALIDENUMERANTEROR is generated if lockingPolicy is
not CGNOLOCKSPOLICY or CGTHREADSAFEPOLICY.
HISTORY
cgSetLockingPolicy was introduced in Cg 2.0.
SEE ALSO
cgGetLockingPolicy
Cg Toolkit 2.1 Last change: 1
|