Changeset 33282f1 in raul


Ignore:
Timestamp:
07/23/17 03:47:03 (3 months ago)
Author:
David Robillard <d@…>
Branches:
master
Children:
4db870b2
Parents:
f0f8a61
git-author:
David Robillard <d@…> (07/23/17 03:46:08)
git-committer:
David Robillard <d@…> (07/23/17 03:47:03)
Message:

Make Semaphore non-copyable

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • raul/Semaphore.hpp

    rd348561 r33282f1  
    5959    } 
    6060 
     61    inline Semaphore(const Semaphore&) = delete; 
     62    inline Semaphore& operator=(const Semaphore&) = delete; 
     63 
    6164    inline ~Semaphore() { 
    6265        destroy(); 
  • test/sem_test.cpp

    rf0f8a61 r33282f1  
    6666 
    6767    // Check that initial value works correctly 
    68     sem = Raul::Semaphore(2); 
    69     assert(sem.wait()); 
    70     assert(sem.wait()); 
    71     assert(!sem.try_wait()); 
     68    Raul::Semaphore sem2(2); 
     69    assert(sem2.wait()); 
     70    assert(sem2.wait()); 
     71    assert(!sem2.try_wait()); 
    7272 
    7373    return 0; 
Note: See TracChangeset for help on using the changeset viewer.