Skip to content

Commit b74987c

Browse files
penguin42Vladimir Sementsov-Ogievskiy
authored andcommitted
util/co-shared-resource: Remove unused co_try_get_from_shres
co_try_get_from_shres hasn't been used since it was added in 55fa54a ("co-shared-resource: protect with a mutex") (Everyone uses the _locked version) Remove it. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Message-Id: <[email protected]> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
1 parent e84af3e commit b74987c

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

include/qemu/co-shared-resource.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ SharedResource *shres_create(uint64_t total);
4444
*/
4545
void shres_destroy(SharedResource *s);
4646

47-
/*
48-
* Try to allocate an amount of @n. Return true on success, and false
49-
* if there is too little left of the collective resource to fulfill
50-
* the request.
51-
*/
52-
bool co_try_get_from_shres(SharedResource *s, uint64_t n);
53-
5447
/*
5548
* Allocate an amount of @n, and, if necessary, yield until
5649
* that becomes possible.

util/qemu-co-shared-resource.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ static bool co_try_get_from_shres_locked(SharedResource *s, uint64_t n)
6666
return false;
6767
}
6868

69-
bool co_try_get_from_shres(SharedResource *s, uint64_t n)
70-
{
71-
QEMU_LOCK_GUARD(&s->lock);
72-
return co_try_get_from_shres_locked(s, n);
73-
}
74-
7569
void coroutine_fn co_get_from_shres(SharedResource *s, uint64_t n)
7670
{
7771
assert(n <= s->total);

0 commit comments

Comments
 (0)