Commit Graph

11 Commits

Author SHA1 Message Date
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
Sam Edwards 9852ada792 dtoolbase: Change export macros to EXP*_DTOOL_DTOOLBASE
This is for consistency with `panda`, which follows this format.
2018-03-25 13:17:52 -06:00
tobspr 0fcfb8e372 New file headers, new comment style 2016-02-17 17:47:48 +01:00
David Rose 539b61571c guarantee word alignment for AtomicAdjust stuff 2011-11-17 23:31:31 +00:00
David Rose c16875f104 use Posix longs 2011-10-31 22:50:28 +00:00
David Rose fb9c56432a we are now using the modified BSD license 2008-05-28 18:37:20 +00:00
David Rose d85b062b2d don't limit counters to 32-bit 2007-11-21 22:42:56 +00:00
David Rose ad6e2116cc better thread safety 2007-06-03 15:42:14 +00:00
David Rose 7986aaa0c3 mutex_spinlock 2006-04-12 15:15:37 +00:00
David Rose 9ce524fc89 better windows locking 2006-04-11 18:15:58 +00:00
David Rose 8a78fffd8f multithreading optimizations, tau profiler, related changes 2006-04-05 19:36:05 +00:00