1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5/*++
6
7
8
9Module Name:
10
11 thread.c
12
13Abstract:
14
15 Implementation of the threads/process functions in the C runtime library
16 that are Windows specific.
17
18
19
20--*/
21
22#include "pal/palinternal.h"
23#include "pal/dbgmsg.h"
24#include "pal/init.h"
25
26SET_DEFAULT_DEBUG_CHANNEL(CRT);
27
28void
29PAL_exit(int status)
30{
31 PERF_ENTRY(exit);
32 ENTRY ("exit(status=%d)\n", status);
33
34 /* should also clean up any resources allocated by pal/cruntime, if any */
35 ExitProcess(status);
36
37 LOGEXIT ("exit returns void");
38 PERF_EXIT(exit);
39}
40
41int
42PAL_atexit(void (__cdecl *function)(void))
43{
44 int ret;
45
46 PERF_ENTRY(atexit);
47 ENTRY ("atexit(function=%p)\n", function);
48 ret = atexit(function);
49 LOGEXIT ("atexit returns int %d", ret);
50 PERF_EXIT(atexit);
51 return ret;
52}
53