mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 07:27:39 +00:00
Place pthread_mutex_init() before init_list()
Fix crash in #2900 Signed-off-by: Shaka Huang <shakalaca@gmail.com>
This commit is contained in:
parent
3c78344812
commit
6dbd9bfb12
@ -239,6 +239,9 @@ int launch_magiskhide() {
|
|||||||
|
|
||||||
LOGI("* Starting MagiskHide\n");
|
LOGI("* Starting MagiskHide\n");
|
||||||
|
|
||||||
|
// Initialize the mutex lock
|
||||||
|
pthread_mutex_init(&monitor_lock, nullptr);
|
||||||
|
|
||||||
// Initialize the hide list
|
// Initialize the hide list
|
||||||
if (!init_list())
|
if (!init_list())
|
||||||
return DAEMON_ERROR;
|
return DAEMON_ERROR;
|
||||||
@ -247,9 +250,6 @@ int launch_magiskhide() {
|
|||||||
if (DAEMON_STATE >= STATE_BOOT_COMPLETE)
|
if (DAEMON_STATE >= STATE_BOOT_COMPLETE)
|
||||||
hide_late_sensitive_props();
|
hide_late_sensitive_props();
|
||||||
|
|
||||||
// Initialize the mutex lock
|
|
||||||
pthread_mutex_init(&monitor_lock, nullptr);
|
|
||||||
|
|
||||||
// Start monitoring
|
// Start monitoring
|
||||||
void *(*start)(void*) = [](void*) -> void* { proc_monitor(); return nullptr; };
|
void *(*start)(void*) = [](void*) -> void* { proc_monitor(); return nullptr; };
|
||||||
if (xpthread_create(&proc_monitor_thread, nullptr, start, nullptr))
|
if (xpthread_create(&proc_monitor_thread, nullptr, start, nullptr))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user