Nasal library: Difference between revisions

Jump to navigation Jump to search
Line 759: Line 759:
== Extension modules ==
== Extension modules ==
=== thread ===
=== thread ===
{{WIP}}
{{Nasal doc
{{Nasal doc
|syntax = thread.newthread(func);
|syntax = thread.newthread(func);
Line 768: Line 770:


{{Nasal doc
{{Nasal doc
|syntax = thread.newlock(func);
|syntax = thread.newlock();
|source = {{simgear file|simgear/nasal/threadlib.c|l=101|t=Source}}
|source = {{simgear file|simgear/nasal/threadlib.c|l=101|t=Source}}
|text =  
|text =  
|example1text = create a new lock
|example1text = create a new lock
|example1 = var lock = thread.newlock()
|example1 = var lock = thread.newlock()
}}
{{Nasal doc
|syntax = thread.lock();
|source = {{simgear file|simgear/nasal/threadlib.c|l=101|t=Source}}
|text =
|example1text = lock a lock
|example1 = var lock = thread.newlock()
}}
{{Nasal doc
|syntax = thread.unlock();
|source = {{simgear file|simgear/nasal/threadlib.c|l=101|t=Source}}
|text =
|example1text = unlock a lock
|example1 = var lock = thread.unlock()
}}
{{Nasal doc
|syntax = thread.newsem();
|source = {{simgear file|simgear/nasal/threadlib.c|l=101|t=Source}}
|text =
|example1text = create a new {{Wikipedia|semaphore}}
|example1 = var semaphore = thread.newsem()
}}
{{Nasal doc
|syntax = thread.semdown();
|source = {{simgear file|simgear/nasal/threadlib.c|l=101|t=Source}}
|text =
|example1text = semaphore down
|example1 = thread.semdown(semaphore)
}}
{{Nasal doc
|syntax = thread.semup();
|source = {{simgear file|simgear/nasal/threadlib.c|l=101|t=Source}}
|text =
|example1text = semaphore up
|example1 = thread.semup(semaphore)
}}
}}


Navigation menu