Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gnome-class
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ian P. Cooke
gnome-class
Commits
350d1fd0
Commit
350d1fd0
authored
Nov 16, 2018
by
Federico Mena Quintero
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'alexcrichton/gnome-class-invalid-type'
parents
3e982566
f62a7c2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
src/gen/privatestatic.rs
src/gen/privatestatic.rs
+18
-12
No files found.
src/gen/privatestatic.rs
View file @
350d1fd0
...
...
@@ -386,23 +386,29 @@ impl<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast>>
// 0 = unlocked, uninitialized
// 1 = locked while the GType is being computed
// anything else = unlocked, actual value of the GType
loop
{
return
loop
{
match
atype
.compare_and_swap
(
0
,
1
,
Ordering
::
SeqCst
)
{
0
=>
{
match
::
std
::
panic
::
catch_unwind
(
get_type_inner
)
{
Ok
(
res
)
=>
{
atype
.store
(
res
,
Ordering
::
SeqCst
);
//Make sure that priv-offset is set first
break
res
;
},
Err
(
err
)
=>
{
atype
.store
(
0
,
Ordering
::
SeqCst
);
//Make sure that priv-offset is set first
::
std
::
panic
::
resume_unwind
(
err
)
}
}
let
mut
unlock
=
Unlock
(
true
,
atype
);
let
ty
=
get_type_inner
();
assert!
(
ty
!=
gobject_ffi
::
G_TYPE_INVALID
);
unlock
.0
=
false
;
atype
.store
(
ty
,
Ordering
::
SeqCst
);
break
ty
},
1
=>
{}
,
1
=>
::
std
::
thread
::
yield_now
()
,
res
=>
{
break
res
}
}
};
struct
Unlock
<
'a
>
(
bool
,
&
'a
AtomicUsize
);
impl
<
'a
>
Drop
for
Unlock
<
'a
>
{
fn
drop
(
&
mut
self
)
{
if
self
.0
{
self
.1
.store
(
0
,
Ordering
::
SeqCst
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment