Thank you! This is actually for a homework assignment where the first part required the use of a counting semaphore to solve the same problem, and I got that working like a charm. But now the next part is to solve the same problem with a monitor, and once I add "synchronized" to the method that gives out the protected resources, it only allows in one
thread at a time no matter what I do. Several people in my class have complained about this same problem, but I just wanted to try to exhaust every avenue before I slap another semaphore on it and call it a day lol. I have been researching and looking through links for hours trying to find an answer, but they all point to semaphores as being the answer for that problem.
I guess I was just trying to see if there was any way at all to do this with a monitor before conceding that it can't be done that way and going with the way I know works but isn't exactly what was asked for.
Thank you again