如果是多个事件的话 可以再加一层锁
boolean
lock
=
true
;
int event = 0;
int
state
= 0;
while
(
true
)
{
while
(
lock
);
lock
=
true
;
switch
(
event
)
{
case
0:
switch
(
state
)
{
case
0:
break
;
}
break
;
}
}