Skip to content

Commit

Permalink
Resolve warnings related to SyncVar#set
Browse files Browse the repository at this point in the history
Replace it with SyncVar#put
  • Loading branch information
Kota Mizushima committed Mar 17, 2016
1 parent ca74109 commit 67b3b9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/library/scala/concurrent/SyncChannel.scala
Expand Up @@ -31,10 +31,10 @@ class SyncChannel[A] {
pendingReads = pendingReads.tail

// let reader continue
readReq set data
readReq put data

// resolve write request
writeReq set true
writeReq put true
}
else {
// enqueue write request
Expand All @@ -57,10 +57,10 @@ class SyncChannel[A] {
pendingWrites = pendingWrites.tail

// let writer continue
writeReq set true
writeReq.put(true)

// resolve read request
readReq set data
readReq.put (data)
}
else {
// enqueue read request
Expand Down
2 changes: 1 addition & 1 deletion src/library/scala/sys/process/ProcessBuilderImpl.scala
Expand Up @@ -56,7 +56,7 @@ private[process] trait ProcessBuilderImpl {
success put false
val t = Spawn({
runImpl(io)
success set true
success.put(true)
}, io.daemonizeThreads)

new ThreadProcess(t, success)
Expand Down
8 changes: 4 additions & 4 deletions src/library/scala/sys/process/ProcessImpl.scala
Expand Up @@ -30,8 +30,8 @@ private[process] trait ProcessImpl {
def apply[T](f: => T): (Thread, () => T) = {
val result = new SyncVar[Either[Throwable, T]]
def run(): Unit =
try result set Right(f)
catch { case e: Exception => result set Left(e) }
try result.put(Right(f))
catch { case e: Exception => result.put(Left(e)) }

val t = Spawn(run())

Expand Down Expand Up @@ -91,8 +91,8 @@ private[process] trait ProcessImpl {

protected lazy val (processThread, getExitValue, destroyer) = {
val code = new SyncVar[Option[Int]]()
code set None
val thread = Spawn(code set runAndExitValue())
code.put(None)
val thread = Spawn(code.put(runAndExitValue()))

(
thread,
Expand Down

0 comments on commit 67b3b9d

Please sign in to comment.