Commit Graph

14 Commits

Author SHA1 Message Date
rdb f45ddcab2f general: switch to C++11 Lockable semantics for mutexes
This renames acquire/release to lock/unlock in order to be compatible with std::lock_guard and std::unique_lock (which will eventually replace the *MutexHolder classes).  It will also allow us to typedef MutexImpl to std::mutex later on.
2018-05-23 20:37:56 +02:00
rdb 0bb81a43c9 express: make a thread safe weak pointer implementation (#321)
To access a WeakPointerTo in a thread-safe way, use something like this:

    if (auto ptr = weak_ptr.lock()) {
      ..use ptr as regular PointerTo
    }

The new implementation no longer needs a reference to be stored to all weak pointers on the WeakReferenceList; a mere count of weak pointers is sufficient.  Therefore, callbacks theoretically no longer require a WeakPointerTo to be constructed.

The WeakPointerTo class is not actually atomic; it could be made so, but I don't believe it's worth it at this time.
2018-05-15 13:40:21 +02:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
rdb 265bf42f81 Fix crash when copying a WeakPointerTo that was already deleted 2015-07-28 13:41:26 +02:00
David Rose 4b5d087246 use more explicit casting chain, to maybe help out the Intel compiler 2011-09-14 14:00:46 +00:00
David Rose 481aa0d8ec fix to typo 2010-04-07 22:54:26 +00:00
rdb 102b46878e More compatibility with exotic compilers (yes, I actually tried to port Panda to clang) 2010-04-07 16:59:46 +00:00
David Rose fb9c56432a we are now using the modified BSD license 2008-05-28 18:37:20 +00:00
David Rose c1091e7b4a build on MSC 2005 2007-02-08 20:14:52 +00:00
David Rose b7ceab1bff integrate PStatThread and Thread; better thread handling in GraphicsEngine::render_frame() 2006-01-31 18:59:49 +00:00
David Rose 61c5bff601 build on gcc 3.4.3 2005-05-16 22:17:54 +00:00
David Rose 475196cbef robustify WeakPointerTo, publish ConstPointerTo 2005-03-11 19:29:57 +00:00
Josh Yelon f15dce600b Fixes for gcc 3.4 2005-02-23 20:50:34 +00:00
David Rose 557060cb1d weak pointers, and FadeLODNode fixes for instances/multiple cameras 2004-09-30 21:29:25 +00:00