Revision: 7961
http://playerstage.svn.sourceforge.net/playerstage/?rev=7961&view=rev
Author: robotos
Date: 2009-07-09 14:17:08 +0000 (Thu, 09 Jul 2009)
Log Message:
-----------
Dont wait forever if we can not open the interface
Modified Paths:
--------------
code/gazebo/trunk/libgazebo/Iface.cc
Modified: code/gazebo/trunk/libgazebo/Iface.cc
===================================================================
--- code/gazebo/trunk/libgazebo/Iface.cc 2009-07-09 13:40:24 UTC (rev
7960)
+++ code/gazebo/trunk/libgazebo/Iface.cc 2009-07-09 14:17:08 UTC (rev
7961)
@@ -268,10 +268,14 @@
// this patch is needed so Gazebo sits and waits for Iface to open when
// spawning robot dynamically
+ int retries = 10;
while (this->mmapFd <= 0)
{
this->mmapFd = open(this->filename.c_str(), O_RDWR);
- usleep(1000000); // wait and try again
+ usleep(500000); // wait 0.5sec and try again
+ retries--;
+ if (retries <0)
+ break;
}
if (this->mmapFd <= 0)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit