Quantcast
Channel: VMware Communities : Discussion List - Virtual Disk Development Kit
Viewing all articles
Browse latest Browse all 2039

Error in SDK 5.5 in method Task.WaitForTask

$
0
0



I was wondering, why the methods Task.WaitForTask sometimes returns immediatly and sometimes wait until the task finishes independent of the given timeout. I looked at the source code with the help of the reflector and found amongst others the following lines of code:


longendTime = (timeout > 0L) ? (DateTime.Now.Millisecond + timeout) : 0L;


if((DateTime.Now.Millisecond > endTime) && (endTime > 0L))


As you can see, the error lies in the usage of the property Millisecond (which returns only the time component of the current timestamp from 0 to 999). As workaround I use the following method:


                              


      


Viewing all articles
Browse latest Browse all 2039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>