Changeset 839 for pjproject/trunk/pjsip/src/pjsip/sip_parser.c
- Timestamp:
- Dec 1, 2006 11:14:37 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r801 r839 282 282 static pj_status_t init_parser() 283 283 { 284 static int initialized;285 284 pj_status_t status; 286 287 if (initialized)288 return PJ_SUCCESS;289 290 initialized = 1;291 285 292 286 /* … … 473 467 void init_sip_parser(void) 474 468 { 475 if (!parser_is_initialized) { 476 if (!parser_is_initialized) { 477 init_parser(); 478 parser_is_initialized = 1; 479 } 480 } 469 pj_enter_critical_section(); 470 if (++parser_is_initialized == 1) { 471 init_parser(); 472 } 473 pj_leave_critical_section(); 474 } 475 476 void deinit_sip_parser(void) 477 { 478 pj_enter_critical_section(); 479 if (--parser_is_initialized == 0) { 480 /* Clear header handlers */ 481 pj_bzero(handler, sizeof(handler)); 482 handler_count = 0; 483 484 /* Clear URI handlers */ 485 pj_bzero(uri_handler, sizeof(uri_handler)); 486 uri_handler_count = 0; 487 } 488 pj_leave_critical_section(); 481 489 } 482 490
Note: See TracChangeset
for help on using the changeset viewer.