Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
711086cc
Commit
711086cc
authored
7 years ago
by
Florian Angerer
Browse files
Options
Downloads
Patches
Plain Diff
Fixed race in RInternalCode.
parent
fd787ecd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RInternalCode.java
+6
-4
6 additions, 4 deletions
...ntime/src/com/oracle/truffle/r/runtime/RInternalCode.java
with
6 additions
and
4 deletions
com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/RInternalCode.java
+
6
−
4
View file @
711086cc
...
...
@@ -44,7 +44,7 @@ public final class RInternalCode {
private
final
String
basePackage
;
private
final
Source
source
;
private
REnvironment
evaluatedEnvironment
;
private
volatile
REnvironment
evaluatedEnvironment
;
private
RInternalCode
(
RContext
context
,
String
basePackage
,
Source
source
)
{
this
.
context
=
context
;
...
...
@@ -57,7 +57,7 @@ public final class RInternalCode {
return
Utils
.
getResourceAsSource
(
clazz
,
fileName
);
}
private
REnvironment
evaluate
()
{
private
synchronized
REnvironment
evaluate
()
{
try
{
RExpression
parsedCode
=
context
.
getThisEngine
().
parse
(
source
);
REnvironment
statsPackage
=
REnvironment
.
getRegisteredNamespace
(
context
,
basePackage
);
...
...
@@ -72,13 +72,15 @@ public final class RInternalCode {
}
}
public
RFunction
lookupFunction
(
String
name
)
{
public
synchronized
RFunction
lookupFunction
(
String
name
)
{
REnvironment
env
=
this
.
evaluatedEnvironment
;
if
(
env
==
null
)
{
env
=
evaluate
();
this
.
evaluatedEnvironment
=
env
;
}
return
(
RFunction
)
env
.
get
(
name
);
RFunction
fun
=
(
RFunction
)
env
.
get
(
name
);
assert
fun
!=
null
;
return
fun
;
}
public
static
RInternalCode
lookup
(
RContext
context
,
String
basePackage
,
Source
source
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment