/[Apache-SVN]
ViewVC logotype

Revision 665402


Jump to revision: Previous Next
Author: dreiss
Date: Thu Dec 20 21:42:05 2007 UTC (16 years, 10 months ago)
Changed paths: 1
Log Message:
Thrift: A hack to prevent incorrect usage of Mutex Guards.

Reviewed By: boz

Test Plan:
dreiss@dreiss-vmware:safe_concurrency:thrift/test$ nl -ba guard_test.cc
     1  #include "../lib/cpp/src/concurrency/Mutex.h"
     2  using facebook::thrift::concurrency::Guard;
     3  void test() {
     4    facebook::thrift::concurrency::Mutex m;
     5    Guard(m);
     6    Guard g1(m);
     7
     8    facebook::thrift::concurrency::ReadWriteMutex rwm;
     9    facebook::thrift::concurrency::RWGuard(m);
    10    facebook::thrift::concurrency::RWGuard g2(rwm);
    11  }
dreiss@dreiss-vmware:safe_concurrency:thrift/test$ g++ -c guard_test.cc
guard_test.cc: In function ‘void test()’:
guard_test.cc:5: error: ‘incorrect_use_of_Guard’ was not declared in this scope
guard_test.cc:9: error: ‘incorrect_use_of_RWGuard’ is not a member of ‘facebook::thrift::concurrency’
dreiss@dreiss-vmware:safe_concurrency:thrift/test$

Revert Plan: ok


Changed paths

Path Details
Directoryincubator/thrift/trunk/lib/cpp/src/concurrency/Mutex.h modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26