File: msvc_tbb_stubs.cpp

package info (click to toggle)
concurrentqueue 1.0.2%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,244 kB
  • sloc: cpp: 13,006; makefile: 82; ansic: 67; python: 46; sh: 18
file content (31 lines) | stat: -rw-r--r-- 883 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "tbb/tbb_main.h"
#include "tbb/itt_notify.h"

#include <atomic>

namespace tbb {
	namespace internal {
		// Taken from tbb_main.cpp (which doesn't compile as-is)

		void call_itt_notify_v5(int /*t*/, void* /*ptr*/) {}

		void itt_store_pointer_with_release_v3(void* dst, void* src) {
			ITT_NOTIFY(sync_releasing, dst);
			__TBB_store_with_release(*static_cast<void**>(dst), src);
		}
	}
}

extern "C" {
#ifdef _WIN64
	__int8 __TBB_machine_cmpswp1(volatile void *ptr, __int8 value, __int8 comparand) {
		return _InterlockedCompareExchange8((__int8*)ptr, value, comparand);
	}
#else
	// Taken from tbb/machine/windows_intel64.h, which isn't included in 32-bit mode but is
	// still used for some reason
	__int64 __TBB_machine_cmpswp8(volatile void *ptr, __int64 value, __int64 comparand) {
		return _InterlockedCompareExchange64((__int64*)ptr, value, comparand);
	}
#endif
}