diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -99,7 +99,7 @@ struct Impl_App { | |||
99 | uint32_t lastTickerTime; | 99 | uint32_t lastTickerTime; |
100 | uint32_t elapsedSinceLastTicker; | 100 | uint32_t elapsedSinceLastTicker; |
101 | iBool running; | 101 | iBool running; |
102 | iBool pendingRefresh; | 102 | iAtomicInt pendingRefresh; |
103 | int tabEnum; | 103 | int tabEnum; |
104 | iStringList *launchCommands; | 104 | iStringList *launchCommands; |
105 | iBool isFinishedLaunching; | 105 | iBool isFinishedLaunching; |
@@ -355,7 +355,7 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
355 | setCStr_String(&d->prefs.downloadDir, downloadDir_App_); | 355 | setCStr_String(&d->prefs.downloadDir, downloadDir_App_); |
356 | d->running = iFalse; | 356 | d->running = iFalse; |
357 | d->window = NULL; | 357 | d->window = NULL; |
358 | d->pendingRefresh = iFalse; | 358 | set_Atomic(&d->pendingRefresh, iFalse); |
359 | d->certs = new_GmCerts(dataDir_App_); | 359 | d->certs = new_GmCerts(dataDir_App_); |
360 | d->visited = new_Visited(); | 360 | d->visited = new_Visited(); |
361 | d->bookmarks = new_Bookmarks(); | 361 | d->bookmarks = new_Bookmarks(); |
@@ -484,7 +484,7 @@ const iString *debugInfo_App(void) { | |||
484 | } | 484 | } |
485 | 485 | ||
486 | iLocalDef iBool isWaitingAllowed_App_(const iApp *d) { | 486 | iLocalDef iBool isWaitingAllowed_App_(const iApp *d) { |
487 | return !d->pendingRefresh && isEmpty_SortedArray(&d->tickers); | 487 | return !value_Atomic(&d->pendingRefresh) && isEmpty_SortedArray(&d->tickers); |
488 | } | 488 | } |
489 | 489 | ||
490 | void processEvents_App(enum iAppEventMode eventMode) { | 490 | void processEvents_App(enum iAppEventMode eventMode) { |
@@ -583,11 +583,11 @@ void refresh_App(void) { | |||
583 | iApp *d = &app_; | 583 | iApp *d = &app_; |
584 | destroyPending_Widget(); | 584 | destroyPending_Widget(); |
585 | draw_Window(d->window); | 585 | draw_Window(d->window); |
586 | d->pendingRefresh = iFalse; | 586 | set_Atomic(&d->pendingRefresh, iFalse); |
587 | } | 587 | } |
588 | 588 | ||
589 | iBool isRefreshPending_App(void) { | 589 | iBool isRefreshPending_App(void) { |
590 | return app_.pendingRefresh; | 590 | return value_Atomic(&app_.pendingRefresh); |
591 | } | 591 | } |
592 | 592 | ||
593 | uint32_t elapsedSinceLastTicker_App(void) { | 593 | uint32_t elapsedSinceLastTicker_App(void) { |
@@ -642,8 +642,8 @@ int run_App(int argc, char **argv) { | |||
642 | 642 | ||
643 | void postRefresh_App(void) { | 643 | void postRefresh_App(void) { |
644 | iApp *d = &app_; | 644 | iApp *d = &app_; |
645 | if (!d->pendingRefresh) { | 645 | const iBool wasPending = exchange_Atomic(&d->pendingRefresh, iTrue); |
646 | d->pendingRefresh = iTrue; | 646 | if (!wasPending) { |
647 | SDL_Event ev; | 647 | SDL_Event ev; |
648 | ev.user.type = SDL_USEREVENT; | 648 | ev.user.type = SDL_USEREVENT; |
649 | ev.user.code = refresh_UserEventCode; | 649 | ev.user.code = refresh_UserEventCode; |