[10201] | 1 | /* $Id: critsection.cpp,v 1.10 2003-08-01 16:25:47 sandervl Exp $ */
|
---|
[1641] | 2 | /*
|
---|
| 3 | * Win32 critical sections
|
---|
| 4 | *
|
---|
| 5 | *
|
---|
[21916] | 6 | *
|
---|
[1641] | 7 | * Copyright 1998 Alexandre Julliard (991031 Port)
|
---|
| 8 | *
|
---|
| 9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 10 | *
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #include <os2win.h>
|
---|
| 14 | #include <assert.h>
|
---|
| 15 | #include <stdio.h>
|
---|
[9910] | 16 | #include <dbglog.h>
|
---|
| 17 | #include <debugtools.h>
|
---|
[1641] | 18 | #include <odinwrap.h>
|
---|
[9910] | 19 | #include <wprocess.h>
|
---|
[1641] | 20 |
|
---|
[2802] | 21 | #define DBG_LOCALLOG DBG_critsection
|
---|
| 22 | #include "dbglocal.h"
|
---|
| 23 |
|
---|
[1641] | 24 | DECLARE_DEBUG_CHANNEL(relay)
|
---|
| 25 |
|
---|
[21302] | 26 | #ifdef DEBUG
|
---|
[1641] | 27 |
|
---|
[21302] | 28 | #include "heapshared.h"
|
---|
| 29 | #include <vmutex.h>
|
---|
[9910] | 30 |
|
---|
[21302] | 31 | typedef struct _CritSectDebug
|
---|
| 32 | {
|
---|
| 33 | struct _CritSectDebug *next;
|
---|
| 34 | struct _CritSectDebug *prev;
|
---|
| 35 | CRITICAL_SECTION *ThisSect;
|
---|
| 36 | HANDLE CreatingThread;
|
---|
| 37 | LONG EnteredCount;
|
---|
| 38 | } CritSectDebug;
|
---|
| 39 |
|
---|
| 40 | CritSectDebug *csfirst = NULL;
|
---|
| 41 | CritSectDebug *cslast = NULL;
|
---|
| 42 | ULONG ulCritSectCount = 0;
|
---|
| 43 |
|
---|
| 44 | VMutex csmutex;
|
---|
| 45 |
|
---|
| 46 | void printCriticalSectionStatistic (void)
|
---|
| 47 | {
|
---|
| 48 | ULONG leakedSectionsCount = 0;
|
---|
| 49 | CritSectDebug *iter = csfirst;
|
---|
| 50 |
|
---|
| 51 | while (iter)
|
---|
| 52 | {
|
---|
| 53 | dprintf(("%d: Section %p, created by thread %8.8X, entered %d\n", leakedSectionsCount, iter->ThisSect, iter->CreatingThread, iter->EnteredCount));
|
---|
| 54 | leakedSectionsCount++;
|
---|
| 55 |
|
---|
| 56 | CritSectDebug *next = iter->next;
|
---|
| 57 | _sfree(iter);
|
---|
| 58 | iter = next;
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | dprintf(("Total leaked sections %d, section count is %d\n", leakedSectionsCount, ulCritSectCount));
|
---|
| 62 | }
|
---|
| 63 |
|
---|
[22021] | 64 | static CritSectDebug *checkCritSectDebug (void *DebugInfo)
|
---|
[21302] | 65 | {
|
---|
[22021] | 66 | if (!DebugInfo)
|
---|
| 67 | return NULL;
|
---|
| 68 |
|
---|
[21302] | 69 | CritSectDebug *iter = csfirst;
|
---|
| 70 |
|
---|
| 71 | while (iter)
|
---|
| 72 | {
|
---|
| 73 | if (iter == DebugInfo)
|
---|
| 74 | {
|
---|
| 75 | break;
|
---|
| 76 | }
|
---|
| 77 |
|
---|
| 78 | iter = iter->next;
|
---|
| 79 | }
|
---|
| 80 |
|
---|
| 81 | if (!iter)
|
---|
| 82 | {
|
---|
| 83 | dprintf(("DebugInfo is not in our list: %p!!!\n", DebugInfo));
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | return iter;
|
---|
| 87 | }
|
---|
| 88 |
|
---|
[22021] | 89 | static void InitializeDebugInfo (CRITICAL_SECTION *crit)
|
---|
[21302] | 90 | {
|
---|
| 91 | csmutex.enter();
|
---|
| 92 | if (checkCritSectDebug (crit->DebugInfo) != NULL)
|
---|
| 93 | {
|
---|
| 94 | dprintf(("InitializeDebugInfo already initialized: DebugInfo %p", crit->DebugInfo));
|
---|
| 95 | }
|
---|
| 96 | else
|
---|
| 97 | {
|
---|
| 98 | CritSectDebug *pdbg = (CritSectDebug *)_smalloc(sizeof (CritSectDebug));
|
---|
| 99 | if (!pdbg)
|
---|
| 100 | {
|
---|
| 101 | dprintf(("InitializeDebugInfo failed to allocate debug info!!!"));
|
---|
| 102 | }
|
---|
| 103 | else
|
---|
| 104 | {
|
---|
| 105 | dprintf(("InitializeDebugInfo DebugInfo: %p", pdbg));
|
---|
| 106 | pdbg->ThisSect = crit;
|
---|
| 107 | pdbg->CreatingThread = ODIN_GetCurrentThreadId();
|
---|
| 108 | pdbg->EnteredCount = 0;
|
---|
| 109 |
|
---|
| 110 | pdbg->next = NULL;
|
---|
| 111 | pdbg->prev = cslast;
|
---|
| 112 | if (cslast)
|
---|
| 113 | {
|
---|
| 114 | cslast->next = pdbg;
|
---|
| 115 | }
|
---|
| 116 |
|
---|
| 117 | cslast = pdbg;
|
---|
| 118 |
|
---|
| 119 | if (!csfirst)
|
---|
| 120 | {
|
---|
| 121 | csfirst = pdbg;
|
---|
| 122 | }
|
---|
| 123 | }
|
---|
| 124 |
|
---|
| 125 | crit->DebugInfo = pdbg;
|
---|
| 126 |
|
---|
| 127 | ulCritSectCount++;
|
---|
| 128 | }
|
---|
| 129 |
|
---|
| 130 | csmutex.leave();
|
---|
| 131 | }
|
---|
| 132 |
|
---|
[22021] | 133 | static void DeleteDebugInfo (CRITICAL_SECTION *crit)
|
---|
[21302] | 134 | {
|
---|
| 135 | csmutex.enter();
|
---|
| 136 |
|
---|
| 137 | CritSectDebug *pdbg = checkCritSectDebug (crit->DebugInfo);
|
---|
| 138 |
|
---|
| 139 | if (pdbg)
|
---|
| 140 | {
|
---|
| 141 | dprintf(("Deleting critical section with DebugInfo == %p\n", pdbg));
|
---|
| 142 |
|
---|
| 143 | if (pdbg->next)
|
---|
| 144 | {
|
---|
| 145 | pdbg->next->prev = pdbg->prev;
|
---|
| 146 | }
|
---|
| 147 | else
|
---|
| 148 | {
|
---|
| 149 | cslast = pdbg->prev;
|
---|
| 150 | }
|
---|
| 151 |
|
---|
| 152 | if (pdbg->prev)
|
---|
| 153 | {
|
---|
| 154 | pdbg->prev->next = pdbg->next;
|
---|
| 155 | }
|
---|
| 156 | else
|
---|
| 157 | {
|
---|
| 158 | csfirst = pdbg->next;
|
---|
| 159 | }
|
---|
| 160 |
|
---|
| 161 | _sfree (pdbg);
|
---|
| 162 |
|
---|
| 163 | ulCritSectCount--;
|
---|
| 164 |
|
---|
| 165 | crit->DebugInfo = NULL;
|
---|
| 166 | }
|
---|
| 167 |
|
---|
| 168 | csmutex.leave();
|
---|
| 169 | }
|
---|
| 170 |
|
---|
[22021] | 171 | static void DebugEnterCritSect (CRITICAL_SECTION *crit)
|
---|
[21302] | 172 | {
|
---|
| 173 | csmutex.enter();
|
---|
| 174 |
|
---|
| 175 | CritSectDebug *pdbg = checkCritSectDebug (crit->DebugInfo);
|
---|
| 176 |
|
---|
| 177 | if (!pdbg)
|
---|
| 178 | {
|
---|
| 179 | InitializeDebugInfo (crit);
|
---|
| 180 | pdbg = checkCritSectDebug (crit->DebugInfo);
|
---|
| 181 | }
|
---|
| 182 |
|
---|
| 183 | if (pdbg)
|
---|
| 184 | {
|
---|
| 185 | pdbg->EnteredCount++;
|
---|
| 186 | }
|
---|
| 187 |
|
---|
| 188 | csmutex.leave();
|
---|
| 189 | }
|
---|
| 190 |
|
---|
[22021] | 191 | static void DebugLeaveCritSect (CRITICAL_SECTION *crit)
|
---|
[21302] | 192 | {
|
---|
| 193 | csmutex.enter();
|
---|
| 194 |
|
---|
| 195 | CritSectDebug *pdbg = checkCritSectDebug (crit->DebugInfo);
|
---|
| 196 |
|
---|
| 197 | if (pdbg)
|
---|
| 198 | {
|
---|
| 199 | pdbg->EnteredCount--;
|
---|
| 200 | }
|
---|
| 201 |
|
---|
| 202 | csmutex.leave();
|
---|
| 203 | }
|
---|
| 204 | #else
|
---|
| 205 | #define InitializeDebugInfo(a)
|
---|
| 206 | #define DeleteDebugInfo(a)
|
---|
| 207 | #define DebugEnterCritSect(a)
|
---|
| 208 | #define DebugLeaveCritSect(a)
|
---|
| 209 | #endif
|
---|
| 210 |
|
---|
| 211 |
|
---|
| 212 |
|
---|
[1641] | 213 | /***********************************************************************
|
---|
[21302] | 214 | * get_semaphore (allocate semaphore only when needed)
|
---|
| 215 | * Assign the semaphore atomically
|
---|
| 216 | */
|
---|
| 217 | static inline HANDLE get_semaphore (CRITICAL_SECTION *crit)
|
---|
| 218 | {
|
---|
| 219 | HANDLE ret = crit->LockSemaphore;
|
---|
| 220 |
|
---|
| 221 | if (!ret)
|
---|
| 222 | {
|
---|
| 223 | HANDLE sem = CreateSemaphoreA (NULL, 0, 1, NULL);
|
---|
| 224 |
|
---|
| 225 | if (sem)
|
---|
| 226 | {
|
---|
| 227 | ret = InterlockedCompareExchange ((PLONG)&crit->LockSemaphore, sem, NULL);
|
---|
| 228 |
|
---|
| 229 | if (ret)
|
---|
| 230 | {
|
---|
| 231 | // semaphore already assigned
|
---|
| 232 | CloseHandle (sem);
|
---|
| 233 | }
|
---|
| 234 | else
|
---|
| 235 | {
|
---|
| 236 | ret = sem;
|
---|
| 237 | }
|
---|
| 238 | }
|
---|
| 239 | }
|
---|
| 240 |
|
---|
| 241 | return ret;
|
---|
| 242 | }
|
---|
| 243 |
|
---|
[21916] | 244 | extern "C" {
|
---|
| 245 |
|
---|
[21302] | 246 | /***********************************************************************
|
---|
[1641] | 247 | * InitializeCriticalSection (KERNEL32.472) (NTDLL.406)
|
---|
| 248 | */
|
---|
| 249 | void WINAPI InitializeCriticalSection( CRITICAL_SECTION *crit )
|
---|
| 250 | {
|
---|
| 251 | dprintf(("InitializeCriticalSection %x", crit));
|
---|
[21302] | 252 |
|
---|
| 253 | InitializeDebugInfo (crit);
|
---|
| 254 |
|
---|
[1641] | 255 | crit->LockCount = -1;
|
---|
| 256 | crit->RecursionCount = 0;
|
---|
| 257 | crit->OwningThread = 0;
|
---|
[21302] | 258 | crit->LockSemaphore = 0;
|
---|
| 259 | crit->Reserved = 0;
|
---|
[1641] | 260 | }
|
---|
| 261 |
|
---|
[10201] | 262 | /***********************************************************************
|
---|
| 263 | * InitializeCriticalSectionAndSpinCount (NTDLL.@)
|
---|
| 264 | * The InitializeCriticalSectionAndSpinCount (KERNEL32) function is
|
---|
| 265 | * available on NT4SP3 or later, and Win98 or later.
|
---|
| 266 | * I am assuming that this is the correct definition given the MSDN
|
---|
| 267 | * docs for the kernel32 functions.
|
---|
| 268 | */
|
---|
| 269 | BOOL WINAPI InitializeCriticalSectionAndSpinCount( CRITICAL_SECTION *crit, DWORD spincount )
|
---|
| 270 | {
|
---|
[21302] | 271 | if (spincount) dprintf(("critsection=%p: spincount=%ld not supported\n", crit, spincount));
|
---|
| 272 | InitializeCriticalSection( crit );
|
---|
[10201] | 273 | crit->Reserved = spincount;
|
---|
| 274 | return TRUE;
|
---|
| 275 | }
|
---|
[1641] | 276 |
|
---|
| 277 | /***********************************************************************
|
---|
| 278 | * DeleteCriticalSection (KERNEL32.185) (NTDLL.327)
|
---|
| 279 | */
|
---|
| 280 | void WINAPI DeleteCriticalSection( CRITICAL_SECTION *crit )
|
---|
| 281 | {
|
---|
| 282 | dprintf(("DeleteCriticalSection %x", crit));
|
---|
| 283 |
|
---|
[21302] | 284 | DeleteDebugInfo (crit);
|
---|
| 285 |
|
---|
[1641] | 286 | if (crit->RecursionCount) /* Should not happen */
|
---|
| 287 | dprintf(("Deleting owned critical section (%p)\n", crit ));
|
---|
| 288 |
|
---|
| 289 | crit->LockCount = -1;
|
---|
| 290 | crit->RecursionCount = 0;
|
---|
| 291 | crit->OwningThread = 0;
|
---|
[21302] | 292 | if (crit->LockSemaphore) CloseHandle( crit->LockSemaphore );
|
---|
[1641] | 293 | crit->LockSemaphore = 0;
|
---|
[21302] | 294 | crit->Reserved = 0;
|
---|
[1641] | 295 | }
|
---|
| 296 |
|
---|
| 297 |
|
---|
| 298 | /***********************************************************************
|
---|
| 299 | * EnterCriticalSection (KERNEL32.195) (NTDLL.344)
|
---|
| 300 | */
|
---|
| 301 | void WINAPI EnterCriticalSection( CRITICAL_SECTION *crit )
|
---|
| 302 | {
|
---|
[21302] | 303 | dprintf2(("EnterCriticalSection %x", crit));
|
---|
[1641] | 304 |
|
---|
[21302] | 305 | #if 0
|
---|
| 306 | /* bird: this is bullcrap, memset(&MyCritSect, 0, sizeof(MyCritSect)) doesn't work in w2k (at least not here).
|
---|
| 307 | * besides this isn't safe. The leave code first sets owner=0 then decrements the lock, heavens knows what
|
---|
| 308 | * will happen if the thread is preemted there...
|
---|
| 309 | */
|
---|
| 310 | // check for uninitialized critical section created with memset (, 0, )
|
---|
| 311 | if (crit->LockCount != -1 && crit->OwningThread == 0)
|
---|
[1641] | 312 | {
|
---|
[21302] | 313 | dprintf(("Uninitialized section!!!"));
|
---|
| 314 | __interrupt(3);
|
---|
| 315 | InitializeCriticalSection (crit);
|
---|
[1641] | 316 | }
|
---|
[21302] | 317 | #endif
|
---|
| 318 |
|
---|
| 319 | DebugEnterCritSect (crit);
|
---|
| 320 |
|
---|
| 321 | if (InterlockedIncrement (&crit->LockCount))
|
---|
[1641] | 322 | {
|
---|
[9910] | 323 | if (crit->OwningThread == ODIN_GetCurrentThreadId())
|
---|
[1641] | 324 | {
|
---|
| 325 | crit->RecursionCount++;
|
---|
| 326 | return;
|
---|
| 327 | }
|
---|
[3275] | 328 |
|
---|
[1641] | 329 | /* Now wait for it */
|
---|
[3275] | 330 | for (;;)
|
---|
[1641] | 331 | {
|
---|
[21302] | 332 | HANDLE sem = get_semaphore (crit);
|
---|
| 333 | DWORD res = WaitForSingleObject (sem, 5000L);
|
---|
| 334 |
|
---|
| 335 | if (res == WAIT_TIMEOUT)
|
---|
[3275] | 336 | {
|
---|
[21302] | 337 | dprintf(("Critical section %p wait timed out, retrying (60 sec)\n", crit));
|
---|
| 338 | res = WaitForSingleObject (sem, 60000L);
|
---|
| 339 | if (res == WAIT_TIMEOUT && TRACE_ON(relay))
|
---|
[3275] | 340 | {
|
---|
[21302] | 341 | dprintf(("Critical section %p wait timed out, retrying (5 min)\n", crit));
|
---|
| 342 | res = WaitForSingleObject (sem, 300000L);
|
---|
[3275] | 343 | }
|
---|
| 344 | }
|
---|
[21302] | 345 |
|
---|
[3275] | 346 | if (res == STATUS_WAIT_0) break;
|
---|
[1641] | 347 |
|
---|
[3275] | 348 | #if 0
|
---|
| 349 | EXCEPTION_RECORD rec;
|
---|
| 350 |
|
---|
| 351 | rec.ExceptionCode = EXCEPTION_CRITICAL_SECTION_WAIT;
|
---|
| 352 | rec.ExceptionFlags = 0;
|
---|
| 353 | rec.ExceptionRecord = NULL;
|
---|
| 354 | rec.ExceptionAddress = RaiseException; /* sic */
|
---|
| 355 | rec.NumberParameters = 1;
|
---|
| 356 | rec.ExceptionInformation[0] = (DWORD)crit;
|
---|
| 357 | RtlRaiseException( &rec );
|
---|
| 358 | #endif
|
---|
[3897] | 359 | dprintf(("ERROR: EnterCritSection: WaitForSingleObject returned %d -> RaiseException", res));
|
---|
[21302] | 360 | RaiseException(EXCEPTION_CRITICAL_SECTION_WAIT, 0, 1, (DWORD *)&crit);
|
---|
[1641] | 361 | }
|
---|
| 362 | }
|
---|
[21302] | 363 |
|
---|
[9910] | 364 | crit->OwningThread = ODIN_GetCurrentThreadId();
|
---|
[1641] | 365 | crit->RecursionCount = 1;
|
---|
| 366 | }
|
---|
| 367 |
|
---|
| 368 |
|
---|
| 369 | /***********************************************************************
|
---|
| 370 | * TryEnterCriticalSection (KERNEL32.898) (NTDLL.969)
|
---|
| 371 | */
|
---|
| 372 | BOOL WINAPI TryEnterCriticalSection( CRITICAL_SECTION *crit )
|
---|
| 373 | {
|
---|
[21302] | 374 | BOOL ret = FALSE;
|
---|
| 375 |
|
---|
[1741] | 376 | dprintf2(("TryEnterCriticalSection %x", crit));
|
---|
[21302] | 377 |
|
---|
| 378 | if (InterlockedCompareExchange (&crit->LockCount, 0, -1) == -1)
|
---|
[1641] | 379 | {
|
---|
[21302] | 380 | // LockCount was successfully changed from -1 to 0 and we own the section now
|
---|
| 381 | crit->OwningThread = ODIN_GetCurrentThreadId();
|
---|
| 382 | crit->RecursionCount = 1;
|
---|
| 383 | ret = TRUE;
|
---|
| 384 | }
|
---|
| 385 | else
|
---|
| 386 | {
|
---|
[9910] | 387 | if (crit->OwningThread == ODIN_GetCurrentThreadId())
|
---|
[1641] | 388 | {
|
---|
[21302] | 389 | InterlockedIncrement (&crit->LockCount);
|
---|
[1641] | 390 | crit->RecursionCount++;
|
---|
[21302] | 391 | ret = TRUE;
|
---|
[1641] | 392 | }
|
---|
| 393 | }
|
---|
[21302] | 394 |
|
---|
| 395 | if (ret) DebugEnterCritSect (crit);
|
---|
| 396 |
|
---|
| 397 | return ret;
|
---|
[1641] | 398 | }
|
---|
| 399 |
|
---|
| 400 |
|
---|
| 401 | /***********************************************************************
|
---|
| 402 | * LeaveCriticalSection (KERNEL32.494) (NTDLL.426)
|
---|
| 403 | */
|
---|
| 404 | void WINAPI LeaveCriticalSection( CRITICAL_SECTION *crit )
|
---|
| 405 | {
|
---|
[1741] | 406 | dprintf2(("LeaveCriticalSection %x", crit));
|
---|
[21302] | 407 |
|
---|
| 408 | DebugLeaveCritSect (crit);
|
---|
| 409 |
|
---|
| 410 | /*
|
---|
| 411 | * Wine and Windows don't check if the caller is the owner.
|
---|
| 412 | * We leave this check in for debugging since odin32 may use this
|
---|
| 413 | * internally and it's good to know if we mess up.
|
---|
| 414 | */
|
---|
| 415 | #ifdef DEBUG
|
---|
| 416 | if (crit->OwningThread != ODIN_GetCurrentThreadId())
|
---|
| 417 | {
|
---|
| 418 | dprintf(("LeaveCriticalSection: Not owner!! OwningThread=%d CurThread=%d\n", crit->OwningThread, ODIN_GetCurrentThreadId()));
|
---|
| 419 | DebugInt3();
|
---|
| 420 | return;
|
---|
| 421 | }
|
---|
| 422 | #endif
|
---|
[21916] | 423 |
|
---|
[1641] | 424 | if (--crit->RecursionCount)
|
---|
| 425 | {
|
---|
[21302] | 426 | InterlockedDecrement(&crit->LockCount);
|
---|
[1641] | 427 | return;
|
---|
| 428 | }
|
---|
[21302] | 429 |
|
---|
[1641] | 430 | crit->OwningThread = 0;
|
---|
[21302] | 431 |
|
---|
[1641] | 432 | if (InterlockedDecrement( &crit->LockCount ) >= 0)
|
---|
| 433 | {
|
---|
| 434 | /* Someone is waiting */
|
---|
[21302] | 435 | HANDLE sem = get_semaphore (crit);
|
---|
| 436 | ReleaseSemaphore (sem, 1, NULL);
|
---|
[1641] | 437 | }
|
---|
| 438 | }
|
---|
| 439 |
|
---|
| 440 |
|
---|
| 441 | /***********************************************************************
|
---|
| 442 | * MakeCriticalSectionGlobal (KERNEL32.515)
|
---|
| 443 | */
|
---|
| 444 | void WINAPI MakeCriticalSectionGlobal( CRITICAL_SECTION *crit )
|
---|
| 445 | {
|
---|
| 446 | dprintf(("MakeCriticalSectionGlobal %x", crit));
|
---|
[21302] | 447 |
|
---|
| 448 | HANDLE sem = get_semaphore(crit);
|
---|
| 449 |
|
---|
| 450 | crit->LockSemaphore = ConvertToGlobalHandle (sem);
|
---|
[1641] | 451 | }
|
---|
| 452 |
|
---|
| 453 |
|
---|
| 454 | /***********************************************************************
|
---|
| 455 | * ReinitializeCriticalSection (KERNEL32.581)
|
---|
| 456 | */
|
---|
| 457 | void WINAPI ReinitializeCriticalSection( CRITICAL_SECTION *crit )
|
---|
| 458 | {
|
---|
| 459 | dprintf(("ReinitializeCriticalSection %x", crit));
|
---|
| 460 |
|
---|
[21302] | 461 | if (!crit->LockSemaphore)
|
---|
[1641] | 462 | {
|
---|
[21302] | 463 | InitializeCriticalSection (crit);
|
---|
[1641] | 464 | }
|
---|
| 465 | }
|
---|
| 466 |
|
---|
| 467 |
|
---|
| 468 | /***********************************************************************
|
---|
| 469 | * UninitializeCriticalSection (KERNEL32.703)
|
---|
| 470 | */
|
---|
| 471 | void WINAPI UninitializeCriticalSection( CRITICAL_SECTION *crit )
|
---|
| 472 | {
|
---|
| 473 | dprintf(("UninitializeCriticalSection %x", crit));
|
---|
[21302] | 474 | DeleteCriticalSection (crit);
|
---|
[1641] | 475 | }
|
---|
| 476 |
|
---|
[21916] | 477 | } // extern "C"
|
---|
| 478 |
|
---|