Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualApEk

Posted 07 December 2012 - 02:47 PM

I have done research on current libraries. All of them make me say why? I'm about to just store a mutex in tracked and lock for any operation. Then instead of weak_ptr::expired do weak_ptr::lock and test the shared_ptr then lock the mutex inside of the erase callback?

Edit: saving thread safety for another time. could probably end up wrapping up the underlying data structure and add locking.

#4ApEk

Posted 09 November 2012 - 07:05 PM

I have done research on current libraries. All of them make me say why? I'm about to just store a mutex in tracked and lock for any operation. Then instead of weak_ptr::expired do weak_ptr::lock and test the shared_ptr then lock the mutex inside of the erase callback?

Edit: first attempt http://code.google.c...t.hpp?name=safe
Edit: I made a new branch for thread safety, but I'm probably going to save finishing thread safety for some other time.

#3ApEk

Posted 08 November 2012 - 10:17 PM

I have done research on current libraries. All of them make me say why? I'm about to just store a mutex in tracked and lock for any operation. Then instead of weak_ptr::expired do weak_ptr::lock and test the shared_ptr then lock the mutex inside of the erase callback?

Edit: first attempt http://code.google.com/p/nano-signal-slot/source/browse/nano_signal_slot.hpp?name=safe

#2ApEk

Posted 08 November 2012 - 10:17 PM

I have done research on current libraries. All of them make me say why? I'm about to just store a mutex in tracked and lock for any operation. Then instead of weak_ptr::expired do weak_ptr::lock and test the shared_ptr then lock the mutex inside of the erase callback?

Edit: first attempt http://code.google.com/p/nano-signal-slot/source/browse/nano_signal_slot.hpp?name=safe

#1ApEk

Posted 08 November 2012 - 08:55 PM

I have done research on current libraries. All of them make me say why? I'm about to just store a mutex in tracked and lock for any operation. Then instead of weak_ptr::expired do weak_ptr::lock and test the shared_ptr then lock the mutex inside of the erase callback?

PARTNERS