439 int is_unlocked = 0;
440
441 if (in_tracker_list(starts_locked, my_id, sm->name, sm->sym))
442 is_locked = 1;
443 if (in_tracker_list(starts_unlocked, my_id, sm->name, sm->sym))
444 is_unlocked = 1;
445 if (is_locked && is_unlocked)
446 return &undefined;
447 if (is_locked)
448 return &locked;
449 if (is_unlocked)
450 return &unlocked;
451 return &undefined;
452 }
453
454 static struct smatch_state *unmatched_state(struct sm_state *sm)
455 {
456 return &start_state;
457 }
458
459 static void pre_merge_hook(struct sm_state *sm)
460 {
461 if (is_impossible_path())
462 set_state(my_id, sm->name, sm->sym, &impossible);
463 }
464
465 static bool nestable(const char *name)
466 {
467 if (strstr(name, "read_sem:"))
468 return true;
469 if (strcmp(name, "bottom_half:") == 0)
470 return true;
471 return false;
472 }
473
474 static void do_lock(const char *name)
475 {
476 struct sm_state *sm;
477
478 if (__inline_fn)
479 return;
480
481 sm = get_sm_state(my_id, name, NULL);
482 if (!sm)
|
439 int is_unlocked = 0;
440
441 if (in_tracker_list(starts_locked, my_id, sm->name, sm->sym))
442 is_locked = 1;
443 if (in_tracker_list(starts_unlocked, my_id, sm->name, sm->sym))
444 is_unlocked = 1;
445 if (is_locked && is_unlocked)
446 return &undefined;
447 if (is_locked)
448 return &locked;
449 if (is_unlocked)
450 return &unlocked;
451 return &undefined;
452 }
453
454 static struct smatch_state *unmatched_state(struct sm_state *sm)
455 {
456 return &start_state;
457 }
458
459 static void pre_merge_hook(struct sm_state *cur, struct sm_state *other)
460 {
461 if (is_impossible_path())
462 set_state(my_id, cur->name, cur->sym, &impossible);
463 }
464
465 static bool nestable(const char *name)
466 {
467 if (strstr(name, "read_sem:"))
468 return true;
469 if (strcmp(name, "bottom_half:") == 0)
470 return true;
471 return false;
472 }
473
474 static void do_lock(const char *name)
475 {
476 struct sm_state *sm;
477
478 if (__inline_fn)
479 return;
480
481 sm = get_sm_state(my_id, name, NULL);
482 if (!sm)
|