That&#39;s exactly what I&#39;m trying to avoid, the wait if you&#39;ve just inserted the disc.<br><br><div class="gmail_quote">2009/7/6 Ryan C. Gordon <span dir="ltr">&lt;<a href="mailto:icculus@icculus.org">icculus@icculus.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I mean, can I use it from a different thread to create a &quot;non-blocking&quot; listing - so that the program doesn&#39;t get blocked while the CD unit spins up<br>
</blockquote>
<br></div>
GetCdRomDirs() doesn&#39;t hold a mutex, and it _should_ be thread safe, presuming the OS-specific APIs are, as well...so it probably won&#39;t block.<br>
<br>
I can&#39;t say with certainty, but I&#39;m pretty sure most platforms don&#39;t access the CD-ROM during this call...at least Linux, Mac OS X, and Windows already know what discs are mounted, and provide this information to the application without having to go back to the hardware.<br>

<br>
I suppose that Windows _might_ block if you put a disc in the drive at the exact moment you called getCdRomDirs(), but I think that&#39;s probably acceptable to the end-user. It shouldn&#39;t block when the drive definitely does or does not have a disc, though, as Windows spun it up already before you asked. Mac OS X and Linux should be safe at any rate.<div>
<div></div><div class="h5"><br>
<br>
--ryan.<br>
<br>
_______________________________________________<br>
physfs mailing list<br>
<a href="mailto:physfs@icculus.org" target="_blank">physfs@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/physfs" target="_blank">http://icculus.org/mailman/listinfo/physfs</a><br>
</div></div></blockquote></div><br>