mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Eliminate the old-style iothread_perform_on_main
All clients now use the std::function form (i.e. lambdas)
This commit is contained in:
parent
144e7b0616
commit
520e567390
1 changed files with 0 additions and 9 deletions
|
@ -44,13 +44,4 @@ int iothread_perform(int (*handler)(T *), T *context) {
|
||||||
/// Performs a function on the main thread, blocking until it completes.
|
/// Performs a function on the main thread, blocking until it completes.
|
||||||
void iothread_perform_on_main(std::function<void(void)> &&func);
|
void iothread_perform_on_main(std::function<void(void)> &&func);
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
int iothread_perform_on_main(int (*handler)(T *), T *context) {
|
|
||||||
int result = 0;
|
|
||||||
iothread_perform_on_main([&result,handler,context](){
|
|
||||||
result = handler(context);
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue