… | |
… | |
1020 | can be done relatively simply by putting mutex_lock/unlock calls around |
1020 | can be done relatively simply by putting mutex_lock/unlock calls around |
1021 | each call to a libev function. |
1021 | each call to a libev function. |
1022 | |
1022 | |
1023 | However, C<ev_run> can run an indefinite time, so it is not feasible |
1023 | However, C<ev_run> can run an indefinite time, so it is not feasible |
1024 | to wait for it to return. One way around this is to wake up the event |
1024 | to wait for it to return. One way around this is to wake up the event |
1025 | loop via C<ev_break> and C<av_async_send>, another way is to set these |
1025 | loop via C<ev_break> and C<ev_async_send>, another way is to set these |
1026 | I<release> and I<acquire> callbacks on the loop. |
1026 | I<release> and I<acquire> callbacks on the loop. |
1027 | |
1027 | |
1028 | When set, then C<release> will be called just before the thread is |
1028 | When set, then C<release> will be called just before the thread is |
1029 | suspended waiting for new events, and C<acquire> is called just |
1029 | suspended waiting for new events, and C<acquire> is called just |
1030 | afterwards. |
1030 | afterwards. |