]> git.sesse.net Git - nageru/blobdiff - nageru/pbo_frame_allocator.cpp
Move from unique_lock to lock_guard everywhere we can. Perhaps ever so slightly clear...
[nageru] / nageru / pbo_frame_allocator.cpp
index c8687025e2f2f1d5dc0d193a07035b01e272f970..6211937b701f21dc2bdfbe916781f71f4629fb6b 100644 (file)
@@ -261,7 +261,7 @@ bmusb::FrameAllocator::Frame PBOFrameAllocator::alloc_frame()
 {
         Frame vf;
 
-       unique_lock<mutex> lock(freelist_mutex);  // Meh.
+       lock_guard<mutex> lock(freelist_mutex);  // Meh.
        if (freelist.empty()) {
                printf("Frame overrun (no more spare PBO frames), dropping frame!\n");
        } else {
@@ -309,7 +309,7 @@ void PBOFrameAllocator::release_frame(Frame frame)
        }
 #endif
 
-       unique_lock<mutex> lock(freelist_mutex);
+       lock_guard<mutex> lock(freelist_mutex);
        freelist.push(frame);
        //--sumsum;
 }