> /* Wait for all readers to complete. */ > > while( p_port->endpt_rdr ) > > - ; > > + { > > + cl_obj_unlock( &p_port->obj ); > > + cl_obj_lock( &p_port->obj ); > > + } How often are there multiple readers? How long does a reader hold the lock for? And do we need to use a spinlock? Also, doesn't complib provide a reader-writer lock abstraction?