少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
 * \file
 * mach support for x86
 *
 * Authors:
 *   Geoff Norton (gnorton@novell.com)
 *
 * (C) 2010 Ximian, Inc.
 */
 
#include <config.h>
#if defined(__MACH__)
#include <glib.h>
#include <mach/mach.h>
#include <mach/task.h>
#include <mach/mach_port.h>
#include <mach/thread_act.h>
#include <mach/thread_status.h>
 
#include <mono/utils/mono-mmap.h>
 
#include "mach-support.h"
 
kern_return_t
mono_mach_get_threads (thread_act_array_t *threads, guint32 *count)
{
    kern_return_t ret;
 
    do {
        ret = task_threads (current_task (), threads, count);
    } while (ret == KERN_ABORTED);
 
    return ret;
}
 
kern_return_t
mono_mach_free_threads (thread_act_array_t threads, guint32 count)
{
    return vm_deallocate(current_task (), (vm_address_t) threads, sizeof (thread_t) * count);
}
#endif