Skip to content

Commit

Permalink
Merge branch 'release/v3.0.0-beta.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
mplatvoet committed Dec 22, 2015
2 parents 667203e + 49fa005 commit 36d0161
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ task { "world" } and task { "Hello" } success {
Please refer to the [Kovenant](http://kovenant.komponents.nl) site for API usage and more.

## Getting started
Build against Kotlin 1.0 beta 4: `1.0.0-beta-4586`.
Build against Kotlin 1.0 beta 4: `1.0.0-beta-4583`.
Source and target compatibility is `1.6`

###Snapshot repository
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/

buildscript {
ext.kotlinVersion = '1.0.0-beta-3595'
ext.kotlinVersion = '1.0.0-beta-4583'
ext.extraConfVersion = '2.2.+'

repositories {
Expand Down Expand Up @@ -79,6 +79,7 @@ subprojects {
compile "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}", optional

testCompile "junit:junit:${junitVersion}"
testCompile "org.jetbrains.kotlin:kotlin-test:${kotlinVersion}"
}


Expand Down
2 changes: 1 addition & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Developed with the following [goals](misc/goals.md) in mind.
* **Dependency free**: when not counting kotlin std

## Getting started
Build against Kotlin 1.0 beta 4: `1.0.0-beta-4586`.
Build against Kotlin 1.0 beta 4: `1.0.0-beta-4583`.
Source and target compatibility is `1.6`

###Snapshot repository
Expand Down
7 changes: 5 additions & 2 deletions projects/core/src/main/kotlin/delegates-jvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@

package nl.komponents.kovenant.properties

import nl.komponents.kovenant.*
import nl.komponents.kovenant.Context
import nl.komponents.kovenant.Kovenant
import nl.komponents.kovenant.Promise
import nl.komponents.kovenant.task
import java.util.concurrent.atomic.AtomicInteger
import kotlin.reflect.KProperty

Expand Down Expand Up @@ -69,7 +72,7 @@ public class LazyPromise<T>(
}
//Signal other threads are more important at the moment
//Since another thread is initializing this property
Thread.yield()
Thread.`yield`()
}
return promise!!
}
Expand Down
6 changes: 3 additions & 3 deletions projects/core/src/main/kotlin/dispatcher-jvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ private class YieldingPollStrategy<V : Any>(private val pollable: Pollable<V>,
for (i in 0..attempts) {
val value = pollable.poll(block = false)
if (value != null) return value
Thread.yield()
if (Thread.currentThread().isInterrupted()) break
Thread.`yield`()
if (Thread.currentThread().isInterrupted) break
}
return null
}
Expand All @@ -491,7 +491,7 @@ private class BusyPollStrategy<V : Any>(private val pollable: Pollable<V>,
for (i in 0..attempts) {
val value = pollable.poll(block = false)
if (value != null) return value
if (Thread.currentThread().isInterrupted()) break
if (Thread.currentThread().isInterrupted) break
}
return null
}
Expand Down
2 changes: 1 addition & 1 deletion projects/core/src/main/kotlin/promises-jvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private class DeferredPromise<V, E>(context: Context) : AbstractPromise<V, E>(co
//Only call this method if we know resolving is eminent.
private fun multipleCompletion(newValue: Any?) {
while (!isDoneInternal()) {
Thread.yield()
Thread.`yield`()
}
context.multipleCompletion(rawValue(), newValue)
}
Expand Down
2 changes: 1 addition & 1 deletion projects/core/src/main/kotlin/properties-jvm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ThreadSafeLazyVar<T>(initializer: () -> T) : ReadWriteProperty<Any?

//Signal other threads are more important at the moment
//Since another thread is initializing this property
Thread.yield()
Thread.`yield`()
}
return unmask<T>(value)
}
Expand Down
4 changes: 2 additions & 2 deletions projects/core/src/test/kotlin/tests/api/get.kt
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ class GetAsyncTest {
thread.start()

startLatch.await()
loop@while (true) when (thread.getState()) {
loop@while (true) when (thread.state) {
Thread.State.BLOCKED, Thread.State.WAITING, Thread.State.TIMED_WAITING -> break@loop
Thread.State.TERMINATED -> break@loop
else -> Thread.yield()
else -> Thread.`yield`()
}
trigger()
stopLatch.await()
Expand Down

0 comments on commit 36d0161

Please sign in to comment.