Use One-Time Initialization for glyph run caching to avoid duplicate glyph run genera...
[gdipp.git] / gdipp_lib / scoped_rw_lock.h
blob042b2e75d56f44408366cace42a055381abe6e23
1 #pragma once
3 #include "gdipp_lib/api.h"
5 namespace gdipp
8 class GDIPP_API scoped_rw_lock
10 public:
11 enum MONITOR_LOCATION
13 CLIENT_COM_HOOK,
14 CLIENT_GAMMA,
15 CONFIG_RENDER_CACHE,
16 CONFIG_RENDER_CONFIG_DELTA_CACHE,
17 GLOBAL_DEBUG,
18 LIB_LRU,
19 SERVER_DC_POOL,
20 SERVER_FONT_MGR,
21 SERVER_FREETYPE,
22 SERVER_GLYPH_CACHE,
23 SERVER_GLYPH_RUN_CACHE,
25 LAST_MONITOR_LOCATION
28 public:
29 static void initialize();
31 explicit scoped_rw_lock(MONITOR_LOCATION srw_location, bool is_shared);
32 ~scoped_rw_lock();
34 private:
35 static std::vector<SRWLOCK> _srws;
37 SRWLOCK *_curr_srw;
38 bool _is_shared;