Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Player::Append blocks thread in wasm

オープン
#921 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust, wasm

調査の方向性

The reporter traces the deadlock to Player::append, which calls sleep_until_end, which blocks on std::sync::mpsc::Receiver::recv. Start by reading that call path and confirming the blocking happens only on the wasm target, where audio runs on the calling thread instead of a separate one. Done means append no longer blocks the single wasm thread, and the clear-then-append sequence from the report completes in a wasm build.

索引モデルが issue の本文から書いたものです。

説明

I try to do simple thing:

  1. Call Player::clear() to stop current audio track
  2. Immediately after that I call Player::append() to play new track
if !player.empty() {
    player.clear();
}
player.append(sound);

It works fine on linux/windows, but it deadlocks my app thread in WASM.
I have a guess why: inside append there is call to sleep_until_end. sleep_until_end does std::sync::mpsc::Receiver::recv inside of it. And recv blocks calling thread. It causes no issues in linux/windows, because rodio lives in separate thread. But in wasm we have single thread for all things and recv blocks it.
(playing sound on empty Player in WASM works fine)

主要言語
Rust
スター
2.5k
フォーク
338
平均マージ
1日 3時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RustAudio/rodio のほかの issue

RustAudio/rodio の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。