2 * Copyright 2008, Michael Lotz, mmlr@mlotz.ch
3 * Distributed under the terms of the MIT License.
11 #include <kscheduler.h>
15 static sem_id sRequestSem
= -1;
19 invalidate_loop(void *data
)
22 if (acquire_sem(sRequestSem
) != B_OK
)
26 message
[0] = sizeof(message
); // size
27 message
[1] = 'KDLE'; // message code
28 message
[2] = 0; // flags
30 // where "d:0:baron' stands for desktop x of user y which both
31 // currently are hardcoded and where '_PTL' is the port link code
32 write_port(find_port("d:0:baron"), '_PTL', &message
, sizeof(message
));
42 release_sem_etc(sRequestSem
, 1, B_DO_NOT_RESCHEDULE
);
47 std_ops(int32 op
, ...)
49 if (op
== B_MODULE_INIT
) {
50 sRequestSem
= create_sem(0, "invalidate_loop_request");
51 if (sRequestSem
< B_OK
)
54 thread_id thread
= spawn_kernel_thread(&invalidate_loop
,
55 "invalidate_loop", B_NORMAL_PRIORITY
, NULL
);
59 resume_thread(thread
);
61 } else if (op
== B_MODULE_UNINIT
) {
62 // deleting the sem will also cause the thread to exit
63 delete_sem(sRequestSem
);
72 static struct debugger_module_info sModuleInfo
= {
74 "debugger/invalidate_on_exit/v1",
85 module_info
*modules
[] = {
86 (module_info
*)&sModuleInfo
,