diff options
Diffstat (limited to 'src/ipcpd/normal/main.c')
-rw-r--r-- | src/ipcpd/normal/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ipcpd/normal/main.c b/src/ipcpd/normal/main.c index 57fb72df..2d416942 100644 --- a/src/ipcpd/normal/main.c +++ b/src/ipcpd/normal/main.c @@ -146,7 +146,14 @@ static int normal_ipcp_enroll(char * dif_name) return -1; } - /* FIXME: Wait until state changed to ENROLLED */ + /* FIXME: Wait passively until state changed to ENROLLED */ + pthread_rwlock_rdlock(&_ipcp->state_lock); + while (_ipcp->state != IPCP_ENROLLED) { + pthread_rwlock_unlock(&_ipcp->state_lock); + sched_yield(); + pthread_rwlock_rdlock(&_ipcp->state_lock); + } + pthread_rwlock_unlock(&_ipcp->state_lock); return 0; } |