From 23151936b6894054b72fd1182bbc0aa645437b5f Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Fri, 3 Oct 2014 22:29:51 +0400 Subject: [PATCH] JS stdlib: added `volatile` and `synchronized`. --- js/js.libraries/src/core/concurrent.kt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 js/js.libraries/src/core/concurrent.kt diff --git a/js/js.libraries/src/core/concurrent.kt b/js/js.libraries/src/core/concurrent.kt new file mode 100644 index 00000000000..800f60e8088 --- /dev/null +++ b/js/js.libraries/src/core/concurrent.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package kotlin + +import kotlin.InlineOption.ONLY_LOCAL_RETURN + +public annotation class volatile + +public annotation class synchronized + +public inline fun synchronized(lock: Any, [inlineOptions(ONLY_LOCAL_RETURN)] block: () -> R): R = block()