diff options
author | 2022-05-09 13:03:01 +0200 | |
---|---|---|
committer | 2022-05-09 13:03:01 +0200 | |
commit | 2b48c417c5b4f2fa78ab0960eb718ff081fa48e6 (patch) | |
tree | d06e9df1772236a571251797a7e0e92f48ae20bb /tools/idevicesyslog.c | |
parent | cad15f71204f32a389bee2797be22f84e7480f58 (diff) | |
download | libimobiledevice-2b48c417c5b4f2fa78ab0960eb718ff081fa48e6.tar.gz libimobiledevice-2b48c417c5b4f2fa78ab0960eb718ff081fa48e6.tar.bz2 |
Add new idevice_events_subscribe/unsubscribe API with context
The older API idevice_event_subscribe/unsubscribe can only be used
by a single instance. With the addition of a context, is is now possible
to register multiple callback functions in different threads.
For backwards compatibility the old API will still be available for a while
before being removed in a future release.
Diffstat (limited to 'tools/idevicesyslog.c')
-rw-r--r-- | tools/idevicesyslog.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index f85c7cc..3084b97 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c | |||
@@ -709,12 +709,13 @@ int main(int argc, char *argv[]) | |||
709 | line_buffer_size = 1024; | 709 | line_buffer_size = 1024; |
710 | line = malloc(line_buffer_size); | 710 | line = malloc(line_buffer_size); |
711 | 711 | ||
712 | idevice_event_subscribe(device_event_cb, NULL); | 712 | idevice_subscription_context_t context = NULL; |
713 | idevice_events_subscribe(&context, device_event_cb, NULL); | ||
713 | 714 | ||
714 | while (!quit_flag) { | 715 | while (!quit_flag) { |
715 | sleep(1); | 716 | sleep(1); |
716 | } | 717 | } |
717 | idevice_event_unsubscribe(); | 718 | idevice_events_unsubscribe(context); |
718 | stop_logging(); | 719 | stop_logging(); |
719 | 720 | ||
720 | if (num_proc_filters > 0) { | 721 | if (num_proc_filters > 0) { |