Eyeon:Script/Reference/Libraries/eyeon/obtaingloballock

From VFXPedia

Jump to: navigation, search


Contents

Usage

eyeon.obtaingloballock(string name, number timeout)

  • name (string, required)

A unique identifier for this lock.

  • timeout (number, optional)

This allows the function to specify a maximum timeout in seconds after which the lock will be released.


Returns

Returns true if the lock was obtained, false if there was a problem.


Remarks

This function can be used to synchronise scripting tasks on a single machine. For example, you might have a script that regularily checks all items in a bin to see if they are stil valid, and another that routinely updates Bin items by reading a shot tracking database. You probably don't want them to do both things at once. So you could protect the appropriate part of the code by using a global lock.

To release the lock, use eyeon.releasegloballock.


Requirements

  • eyeonScript 5.1


Examples




Tips for obtaingloballock (edit)

EyeonTips:Script/Reference/Libraries/eyeon/obtaingloballock