previous up next     contents index
Next: Global Variable Namespaces Up: Threads Previous: Threads

Utilities

  (current-thread) returns the thread descriptor for the currently executing thread.

  (thread? v) returns #t if v is a thread descriptor or #f otherwise.

  (sleep time) causes the current thread to sleep for at least time seconds. The time argument defaults to 0 (allowing other threads to execute when operating system threads are not used). The value of time can be non-integral to request a sleep duration to any precision, but the precision of the actual sleep time is unspecified (but the the thread will sleep at least time seconds).

  (kill-thread thread) terminates the specified thread immediately. Terminating the main thread exits the application.

  (thread-weight thread) returns the weight of the specified thread. A thread weight is a positive fixnum indicating how much work this thread can perform before another thread is swapped in. The default weight is 10000. The weight is only meaningful when operating system threads are not used to implement MzScheme threads.

  (set-thread-weight! thread weight) sets the weight of thread.



PLT