Skip to content

Commit

Permalink
unix: add thread affinity support on openharmony (libuv#4705)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlow authored Feb 21, 2025
1 parent 82cdfb7 commit b807450
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unix/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ int uv_thread_setaffinity(uv_thread_t* tid,
if (cpumask[i])
CPU_SET(i, &cpuset);

#if defined(__ANDROID__)
#if defined(__ANDROID__) || defined(__OHOS__)
if (sched_setaffinity(pthread_gettid_np(*tid), sizeof(cpuset), &cpuset))
r = errno;
else
Expand Down Expand Up @@ -242,7 +242,7 @@ int uv_thread_getaffinity(uv_thread_t* tid,
return UV_EINVAL;

CPU_ZERO(&cpuset);
#if defined(__ANDROID__)
#if defined(__ANDROID__) || defined(__OHOS__)
if (sched_getaffinity(pthread_gettid_np(*tid), sizeof(cpuset), &cpuset))
r = errno;
else
Expand Down

0 comments on commit b807450

Please sign in to comment.