Skip to content

Unexpected behavior with DMON_SLEEP_INTERVAL 1000 on linux #40

Description

@ludolpif

Hi,
I get some infinite hangs in my SDL3 app while setting a new dmon watcher.

  • DMON_SLEEP_INTERVAL 999 : nothing bad happens
  • DMON_SLEEP_INTERVAL 1000 : hangs
  • DMON_SLEEP_INTERVAL 1001 : hangs

I am unsure, but I suspect this:

struct timespec req = { (time_t)DMON_SLEEP_INTERVAL / 1000, (long)(DMON_SLEEP_INTERVAL * 1000000) };
nanosleep(&req, &rem);

to wait "forever" , then another part is stuck in a mutex wait as seergdb shown me. The nanosecond part should never exceed 999999999, it miss a %1000 I think (untested).

struct timespec req = { (time_t)DMON_SLEEP_INTERVAL / 1000, (long)((DMON_SLEEP_INTERVAL % 1000) * 1000000) };

Cheers,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions