4 NOBUG_DEFINE_FLAG_LIMIT(test
, LOG_DEBUG
);
12 NOBUG_RESOURCE_HANDLE_INIT (t1
);
14 NOBUG_RESOURCE_HANDLE_INIT (t2
);
16 RESOURCE_ANNOUNCE(test
, "type1", "test1", main
, t1
);
17 RESOURCE_ANNOUNCE(test
, "type2", "test2", main
+1, t2
);
20 NOBUG_RESOURCE_HANDLE_INIT (e1
);
22 NOBUG_RESOURCE_HANDLE_INIT (e2
);
24 WARN(NOBUG_ON
, "foo");
26 RESOURCE_ENTER(test
, t1
, "user1", main
, NOBUG_RESOURCE_WAITING
, e1
);
27 RESOURCE_STATE(test
, e1
, NOBUG_RESOURCE_RECURSIVE
);
28 RESOURCE_ENTER(test
, t1
, "user1", main
, NOBUG_RESOURCE_RECURSIVE
, e1
);
30 RESOURCE_ENTER(test
, t1
, "user2", main
+1, NOBUG_RESOURCE_EXCLUSIVE
, e2
);
32 nobug_resource_dump_all (stderr
);
34 nobug_resource_dump_resources (stderr
);
36 RESOURCE_LEAVE(test
, e1
);
38 nobug_resource_dump_all (stderr
);
40 nobug_resource_dump_resources (stderr
);
42 NOBUG_RESOURCE_LEAVE_LOOKUP(test
, t1
, main
);
44 nobug_resource_dump_all (stderr
);
46 RESOURCE_LEAVE(test
, e2
);
48 nobug_resource_dump_all (stderr
);
50 RESOURCE_FORGET(test
, t1
);
52 nobug_resource_dump_all (stderr
);
54 RESOURCE_FORGET(test
, t2
);
56 nobug_resource_dump_resources (stderr
);