MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / tty_wait

Function tty_wait

components/lwp/terminal/freebsd/tty.c:1024–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1022}
1023
1024int tty_wait(struct lwp_tty *tp, struct rt_condvar *cv)
1025{
1026 int error;
1027 int revokecnt = tp->t_revokecnt;
1028
1029 tty_lock_assert(tp, MA_OWNED | MA_NOTRECURSED);
1030 MPASS(!tty_gone(tp));
1031
1032 error = cv_wait_sig(cv, tp->t_mtx);
1033
1034 /* Bail out when the device slipped away. */
1035 if (tty_gone(tp))
1036 return -ENXIO;
1037
1038 /* Restart the system call when we may have been revoked. */
1039 if (tp->t_revokecnt != revokecnt)
1040 return -ERESTART;
1041
1042 return error;
1043}
1044
1045int tty_timedwait(struct lwp_tty *tp, struct rt_condvar *cv, rt_tick_t timeout)
1046{

Callers 7

ttydisc_read_canonicalFunction · 0.85
ttydisc_writeFunction · 0.85
ttydev_openFunction · 0.85
tty_wait_backgroundFunction · 0.85
ttydev_writeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected