I am reading the book: Intel Threading Building Blocks. I often have difficulties understanding them. For example,the following code is from the book(page 112):
Node* AllocateNode() {
Node* n;
FreeListMutexType::scoped_lock lock;
lock.acquire(FreeListMutex);
n=FreeList;
if(n)
Freelist=n->next;
lock.release();
if(!n)
n=new Node();
return n;
}
There is other introduction regarding this code. I can not understand it. What does it means? How can I understand this book better? Thanks.