[Insight-developers] ITK MutexLock(s) missing try lock

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Mar 12 13:55:34 EDT 2014


Hello,

I wanted to add a little safety to a section of code in SimpleITK. So I wanted to add a mutex lock around a critical section, and if second thread tried to execute it, then an exceptions should be thrown.

I thought a mutex lock was the appropriate tool. So I looked at ITK's SimpleMutexLock[1], and SimpleFastMutexLock[2]. Unfortunately the expected "TryLock" was missing.

I could also use an atomic integer as the lock/flag, but that's not available either.

Any suggestions? This ought to be some where in ITK!

Thanks,
Brad


[1] http://www.itk.org/Doxygen/html/classitk_1_1SimpleMutexLock.html
[2] http://www.itk.org/Doxygen/html/classitk_1_1SimpleFastMutexLock.html


More information about the Insight-developers mailing list