mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
Adopt lamba-style perform_on_main in the tests
This commit is contained in:
parent
fe8e99138d
commit
144e7b0616
1 changed files with 1 additions and 7 deletions
|
@ -511,16 +511,10 @@ static void test_tokenizer() {
|
||||||
err(L"redirection_type_for_string failed on line %ld", (long)__LINE__);
|
err(L"redirection_type_for_string failed on line %ld", (long)__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Little function that runs in the main thread.
|
|
||||||
static int test_iothread_main_call(int *addr) {
|
|
||||||
*addr += 1;
|
|
||||||
return *addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Little function that runs in a background thread, bouncing to the main.
|
// Little function that runs in a background thread, bouncing to the main.
|
||||||
static int test_iothread_thread_call(int *addr) {
|
static int test_iothread_thread_call(int *addr) {
|
||||||
int before = *addr;
|
int before = *addr;
|
||||||
iothread_perform_on_main(test_iothread_main_call, addr);
|
iothread_perform_on_main([=](){ *addr += 1; });
|
||||||
int after = *addr;
|
int after = *addr;
|
||||||
|
|
||||||
// Must have incremented it at least once.
|
// Must have incremented it at least once.
|
||||||
|
|
Loading…
Reference in a new issue