| 2396 | |
| 2397 | |
| 2398 | int ISC_mutex_init(struct mtx* mutex, const TEXT* mutex_name) |
| 2399 | { |
| 2400 | /************************************** |
| 2401 | * |
| 2402 | * I S C _ m u t e x _ i n i t ( W I N _ N T ) |
| 2403 | * |
| 2404 | ************************************** |
| 2405 | * |
| 2406 | * Functional description |
| 2407 | * Initialize a mutex. |
| 2408 | * |
| 2409 | **************************************/ |
| 2410 | char name_buffer[MAXPATHLEN]; |
| 2411 | |
| 2412 | if (!make_object_name(name_buffer, sizeof(name_buffer), mutex_name, "_mutex")) |
| 2413 | { |
| 2414 | return FB_FAILURE; |
| 2415 | } |
| 2416 | |
| 2417 | if (initializeFastMutex(&mutex->mtx_fast, ISC_get_security_desc(), FALSE, name_buffer)) |
| 2418 | return FB_SUCCESS; |
| 2419 | |
| 2420 | fb_assert(GetLastError() != 0); |
| 2421 | return GetLastError(); |
| 2422 | } |
| 2423 | |
| 2424 | |
| 2425 | void ISC_mutex_fini(struct mtx *mutex) |
no test coverage detected