Multiuser Lingo Dictionary > Multiuser Lingo Dictionary > awaitValue() |  |

awaitValue()

Syntax

    whichThread.awaitValue()

Description

Multiuser Server server-side function; returns a value in a variable from the specified thread. The current thread stops executing until the specified thread produces a value with `produceValue()`.

This function should be used for a single thread awaiting a value for a single other thread. To send values to multiple threads, use `lock()`, `wait()`, `notifyAll()`, and `unlock()`.

Example

The following handler gets a value from the thread `testThread`. The thread that contains the handler is blocked from running further until the value is produced by `testThread`.

    on retrieveNumber
    	testThread.awaitValue()
    end

See also

`lock()`, `wait()`, `notifyAll()`, `unlock()`, `produceValue()`, `sleep()`