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

Temporary PR for Emscripten #9407

Closed
wants to merge 11 commits into from

Conversation

oleg-derevenetz
Copy link
Collaborator

Related to #9406

@ololoken
Copy link
Contributor

ololoken commented Jan 3, 2025

@ihhub look

 #ifdef __EMSCRIPTEN__
     EM_ASM( FS.syncfs( err = > err && console.warn( "FS.syncfs() error:", err ) ) );
 #endif

linter suggested you invalid js code: err = > err && .... is not ok
so it's better disable clang-format checks for these lines


#ifdef __EMSCRIPTEN__
// clang-format off
EM_ASM( FS.syncfs( err => err && console.warn( "FS.syncfs() error:", err ) ) );
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that this call is no-op if there is nothing to sync, but if it leads to performance issues (since now it is called every time when StreamFile instance is closed and/or destroyed), it will be possible to think about how to optimize it.


{
// In accordance with the contract, the _mutex should NOT be acquired while calling the executeTask().
MutexUnlocker unlocker( _mutex );
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that mutexes under Emscripten are "only for show", but it's better be safe than sorry, so we need to unlock the mutex if it is promised by the contract.

@oleg-derevenetz oleg-derevenetz deleted the emscripten-tmp branch January 3, 2025 19:30
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

Successfully merging this pull request may close these issues.

2 participants