Summary:
* folly/test/SpinLockTest.cpp (trylockTestThread):
Change parameter type from int to size_t, to fix these:
folly/test/SpinLockTest.cpp:67:25: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
folly/test/SpinLockTest.cpp:82:60: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
Test Plan:
Run this and note there are fewer errors than before:
fbconfig --platform-all=gcc-4.9-glibc-2.20 -r folly && fbmake dbgo
Reviewed By: philipp@fb.com
Subscribers: net-systems@, folly-diffs@
FB internal diff:
D1770564
Tasks:
5941250
Signature: t1:
1770564:
1420674373:
fa3020398e2df66590eb71f798419b6f555d07c4
};
template <typename LOCK>
-void trylockTestThread(TryLockState<LOCK>* state, int count) {
+void trylockTestThread(TryLockState<LOCK>* state, size_t count) {
while (true) {
asm("pause");
SpinLockGuardImpl<LOCK> g(state->lock1);
int nthrs = sysconf(_SC_NPROCESSORS_ONLN) + 4;
std::vector<std::thread> threads;
TryLockState<LOCK> state;
- int count = 100;
+ size_t count = 100;
for (int i = 0; i < nthrs; ++i) {
threads.push_back(std::thread(trylockTestThread<LOCK>, &state, count));
}