Although it is mentioned in the document that actionscript provides thread safety internally.
I am still confused.
I list 2 questions in the comments below.
Code: Select all
// global variable
var lock = false;
function handleRequest(cmd, params, user, fromRoom)
{
if (!lock) {
// Question1: Is it possible that mutiple threads enter this block concurrently?
lock = true;
// Question2: Is the code here thread safe?
lock =false;
}
}
Thanks.