use usleep when waiting for cref to be available

This commit is contained in:
Eric House 2013-01-11 20:37:08 -08:00
parent f827bebf80
commit 39d12d088a

View file

@ -24,6 +24,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <pthread.h> #include <pthread.h>
#include <unistd.h>
#include "crefmgr.h" #include "crefmgr.h"
#include "cref.h" #include "cref.h"
@ -413,6 +414,8 @@ CRefMgr::getCookieRef( CookieID cid, bool failOk )
break; break;
} }
m_cidlock->Relinquish( cinfo, true ); m_cidlock->Relinquish( cinfo, true );
logf( XW_LOGINFO, "%s: sleeping after failing to get cinfo", __func__ );
usleep(200000); /* 2/10 second */
} }
return cinfo; return cinfo;
} /* getCookieRef */ } /* getCookieRef */