Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gürcan Güleç
/
iag0581
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c2b90ce5
authored
Oct 19, 2016
by
Gürcan Güleç
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Committing the style.c file
parent
1e993acd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
labs/style15.c
labs/style15.c
0 → 100644
View file @
c2b90ce5
static
bool
cl_block_try_disable_access
(
cl_block
*
block
,
int
discard_data
)
{
if
(
!
cl_try_lock
(
&
block
->
writer_lock
))
{
return
false
;
}
if
(
!
cl_try_lock
(
&
block
->
reader_lock
))
{
icl_unlock
(
&
block
->
writer_lock
);
return
false
;
}
if
(
!
discard_data
&&
(
block
->
bytes_read
!=
cl_block_get_bytes_committed
(
block
)))
{
cl_unlock
(
&
block
->
reader_lock
);
cl_unlock
(
&
block
->
writer_lock
);
return
false
;
}
cl_block_set_bytes_committed
(
block
,
0
);
block
->
bytes_read
=
0
;
return
true
;
}
static
void
cl_block_enable_access
(
cl_block
*
block
)
{
cl_unlock
(
&
block
->
reader_lock
);
cl_unlock
(
&
block
->
writer_lock
);
}
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