Skip to content

Commit

Permalink
Add support for Windows phmap::srwlock
Browse files Browse the repository at this point in the history
  • Loading branch information
greg7mdp committed Nov 19, 2023
1 parent 1364737 commit 09f5b11
Showing 2 changed files with 147 additions and 116 deletions.
11 changes: 1 addition & 10 deletions examples/phmap/lazy_emplace_l.cpp
Original file line number Diff line number Diff line change
@@ -9,22 +9,13 @@
#include <ppl.h>
#include <vector>

class srwlock {
SRWLOCK _lock;

public:
srwlock() { InitializeSRWLock(&_lock); }
void lock() { AcquireSRWLockExclusive(&_lock); }
void unlock() { ReleaseSRWLockExclusive(&_lock); }
};

using Map = gtl::parallel_flat_hash_map<std::string,
int,
gtl::priv::hash_default_hash<std::string>,
gtl::priv::hash_default_eq<std::string>,
std::allocator<std::pair<const std::string, int>>,
8,
srwlock>;
gtl::srwlock>;

class Dict {
Map m_stringsMap;
Loading

0 comments on commit 09f5b11

Please sign in to comment.