Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass AbortSignal to C code #4539

Open
2 tasks done
dormeiri-port opened this issue Jan 28, 2025 · 0 comments
Open
2 tasks done

Pass AbortSignal to C code #4539

dormeiri-port opened this issue Jan 28, 2025 · 0 comments

Comments

@dormeiri-port
Copy link

dormeiri-port commented Jan 28, 2025

Node.js Version

v22.13.1

NPM Version

v10.9.2

Operating System

MacOS Sequoia 15.2

Subsystem

Other

Description

I’m working with an AbortSignal and some C code (extern "C"). I need to pass a reference of AbortSignal.aborted (a boolean) to the C code, which is running in async work.

Right now, I’m using a bool * and addEventListener in C++ with NAPI to update the boolean pointer which is passed to the C code, but this hurts performance. Is there a way to directly reference aborted from C?

Thanks!

Minimal Reproduction

No response

Output

No response

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant