Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
73 user(s) are online (59 user(s) are browsing Forums)

Members: 0
Guests: 73

more...

Support us!

Headlines

Report message:*
 

Re: MineCraft (MineTest) work in progress help need it

Subject: Re: MineCraft (MineTest) work in progress help need it
by kas1e on 2021/1/10 7:28:21

@Frederik

I also switched now to the latest sources of minecraft (so avoid any possible issues with 3 years old version we testing now). And they add sem_trywait() which we didn't have in our posix_semaphores. See how they use it in semaphore.cpp

int ret;
    if (
time_ms 0) {
        
struct timespec wait_time;
        
struct timeval now;

        if (
gettimeofday(&nowNULL) == -1) {
            
std::cerr << "Semaphore::wait(ms): Unable to get time with gettimeofday!" << std::endl;
            
abort();
        }

        
wait_time.tv_nsec = ((time_ms 1000) * 1000 1000) + (now.tv_usec 1000);
        
wait_time.tv_sec  = (time_ms 1000) + (wait_time.tv_nsec / (1000 1000 1000)) + now.tv_sec;
        
wait_time.tv_nsec %= 1000 1000 1000;

        
ret sem_timedwait(&semaphore, &wait_time);
    } else {
        
ret sem_trywait(&semaphore);
    }


Can you add this one as well ?

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project