Skip to content

fix(bthread): drop unimplemented barrier and rwlockattr APIs - #3504

Open
darion-yaphet wants to merge 1 commit into
apache:masterfrom
darion-yaphet:remove-unimplemented-bthread-apis
Open

fix(bthread): drop unimplemented barrier and rwlockattr APIs#3504
darion-yaphet wants to merge 1 commit into
apache:masterfrom
darion-yaphet:remove-unimplemented-bthread-apis

Conversation

@darion-yaphet

@darion-yaphet darion-yaphet commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Problem Summary:
bthread.h declared POSIX-style barrier APIs (bthread_barrier_init/destroy/wait) and rwlock attribute APIs (bthread_rwlockattr_init/destroy/getkind_np/setkind_np) that were never defined in libbrpc. Compiling against the headers succeeded, then linking failed with undefined reference. The headers advertised an API that the library does not provide.

What is changed and the side effects?

Changed:

  • Remove unimplemented bthread_barrier_* declarations and the unused bthread_barrier_t / bthread_barrierattr_t types.
  • Remove unimplemented bthread_rwlockattr_* declarations.
  • Keep bthread_rwlockattr_t because it is still the argument type of the implemented bthread_rwlock_init().
  • Document that bthread_rwlock_init() currently ignores attr.

Side effects:

  • Performance effects: none.

  • Breaking backward compatibility: source-incompatible only for code that called these never-linked symbols. Working programs that already linked against brpc could not have been using them. bthread_rwlock_init() signature is unchanged.


Check List:

These declarations had no definitions, so calling them failed at
link time. Keep bthread_rwlockattr_t for bthread_rwlock_init().

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant