diff options
author | Leith Bade <leith@leithalweapon.geek.nz> | 2014-11-09 22:54:05 +1100 |
---|---|---|
committer | Leith Bade <leith@leithalweapon.geek.nz> | 2014-11-09 22:54:05 +1100 |
commit | 3696e051935648c38a003291bd1e6bea202a2e3d (patch) | |
tree | 558acf3d97a7789adb13af8fa9d541940b6a42d1 /src | |
parent | 28d66bb6f856b3836616f9574c38dbb9fe749d92 (diff) | |
download | qtlocation-mapboxgl-3696e051935648c38a003291bd1e6bea202a2e3d.tar.gz |
Add async asserts
Diffstat (limited to 'src')
-rw-r--r-- | src/map/map.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp index ed105375fb..2de77cd3c7 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -78,7 +78,7 @@ uv::worker &Map::getWorker() { return *workers; } -void Map::start() { // TODO add pause arg +void Map::start(bool start_paused) { assert(uv_thread_self() == main_thread); assert(!async); @@ -89,6 +89,11 @@ void Map::start() { // TODO add pause arg // Reset the flag. is_stopped = false; + // Do we need to pause first? + if (start_paused) { + pause(); + } + // Setup async notifications // Iron out the differences between libuv 0.10 and 0.11 @@ -159,8 +164,9 @@ void Map::stop(stop_callback cb, void *data) { async = false; } -void Map::pause() { +void Map::pause(bool wait_for_pause) { assert(uv_thread_self() == main_thread); + assert(async); Log::Info(Event::General, "Map::pause() start"); // TODO wait until paused before return @@ -182,6 +188,7 @@ void Map::pause() { void Map::resume() { assert(uv_thread_self() == main_thread); + assert(async); Log::Info(Event::General, "Map::resume() start"); Log::Info(Event::General, "Map::resume() locking"); |