| 874 | } |
| 875 | |
| 876 | bool MTGS::WaitForOpen() |
| 877 | { |
| 878 | if (IsOpen()) |
| 879 | return true; |
| 880 | |
| 881 | StartThread(); |
| 882 | |
| 883 | // request open, and kick the thread. |
| 884 | s_open_flag.store(true, std::memory_order_release); |
| 885 | s_sem_event.NotifyOfWork(); |
| 886 | |
| 887 | // wait for it to finish its stuff |
| 888 | s_open_or_close_done.Wait(); |
| 889 | |
| 890 | // did we succeed? |
| 891 | const bool result = s_open_flag.load(std::memory_order_acquire); |
| 892 | if (!result) |
| 893 | Console.Error("GS failed to open."); |
| 894 | |
| 895 | return result; |
| 896 | } |
| 897 | |
| 898 | void MTGS::WaitForClose() |
| 899 | { |
nothing calls this directly
no test coverage detected