U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » Critical section in PteBase::PtrAdd
Critical section in PteBase::PtrAdd [message #45828] Mon, 11 January 2016 12:18 Go to previous message
qapko is currently offline  qapko
Messages: 55
Registered: October 2007
Location: Slovakia
Member
Hello,

out of curiosity I have studied the implementation of Ptr template and noticed, that in PteBase::PtrAdd the critical section sPteLock is leaved at the beginning of the else block, just before writing to "prec" and its subitems. Is it OK? If yes, why? At first glance I would suppose, that because of some risk of race condition here, the sPteLock should be leaved at the end of the else block. Am I missing something?

Gabi
 
Read Message
Read Message
Read Message
Previous Topic: Print to desired configured printer without dialog
Next Topic: Time in milliseconds
Goto Forum:
  


Current Time: Thu Sep 03 07:07:04 GMT+2 2026

Total time taken to generate the page: 0.00646 seconds