| 432 | /////////////////////////////////////////// |
| 433 | |
| 434 | void sk_assert_thread_valid() { |
| 435 | // sk_init and sk_run/step need to happen on the same thread, but there's a |
| 436 | // non-zero chance that some async code can inadvertently put execution |
| 437 | // onto another thread without the dev's knowledge. This can trip up async |
| 438 | // asset code and cause a blocking loop as the asset waits for the main |
| 439 | // thread to step. This function is used to detect and warn of such a |
| 440 | // situation. |
| 441 | |
| 442 | if (ft_id_matches(local.init_thread) == false) { |
| 443 | const char* err = "SK.Run and pre-Run GPU asset creation currently must be called on the same thread as SK.Initialize! Has async code accidentally bumped you to another thread?"; |
| 444 | log_err(err); |
| 445 | platform_msgbox_err(err, "Fatal Error"); |
| 446 | abort(); |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | /////////////////////////////////////////// |
| 451 |
no test coverage detected